Skip to content

Commit 59a940a

Browse files
committed
fix: don't switch the viewed file when opening all changed files
1 parent b0a28dd commit 59a940a

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/extensions/default/Git/src/Panel.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,17 +1019,8 @@ define(function (require, exports) {
10191019
const OPEN_ALL_CONFIRM_THRESHOLD = 50;
10201020

10211021
function _openChangedFiles(fileList) {
1022-
// addListToWorkingSet ignores files already present in any pane, so this is safe
1023-
// to run repeatedly or with some of the files already open
10241022
MainViewManager.addListToWorkingSet(MainViewManager.ACTIVE_PANE, fileList);
1025-
1026-
// if the user is already viewing one of the changed files, we don't switch the file then...
1027-
// if user is viewing a un-changed file, then we switch to the first changed file
1028-
const currentPath = MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE);
1029-
const viewingChangedFile = _.any(fileList, function (file) {
1030-
return file.fullPath === currentPath;
1031-
});
1032-
if (!viewingChangedFile) {
1023+
if (!MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE)) {
10331024
CommandManager.execute(Commands.FILE_OPEN, { fullPath: fileList[0].fullPath });
10341025
}
10351026
}

0 commit comments

Comments
 (0)