File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,15 @@ export class DiffWithNextCommand extends ActiveEditorCommand {
3636
3737 let isInLeftSideOfDiffEditor = false ;
3838
39- // Figure out if we are in a diff editor and if so, which side
40- const [ tab ] = getVisibleTabs ( uri ) ;
41- if ( tab != null ) {
42- const uris = getTabUris ( tab ) ;
43- // If there is an original, then we are in a diff editor -- modified is right, original is left
44- if ( uris . original != null && uriEquals ( uri , uris . original ) ) {
45- isInLeftSideOfDiffEditor = true ;
39+ if ( args . commit == null ) {
40+ // Figure out if we are in a diff editor and if so, which side
41+ const [ tab ] = getVisibleTabs ( uri ) ;
42+ if ( tab != null ) {
43+ const uris = getTabUris ( tab ) ;
44+ // If there is an original, then we are in a diff editor -- modified is right, original is left
45+ if ( uris . original != null && uriEquals ( uri , uris . original ) ) {
46+ isInLeftSideOfDiffEditor = true ;
47+ }
4648 }
4749 }
4850
Original file line number Diff line number Diff line change @@ -74,15 +74,17 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
7474 let isInRightSideOfDiffEditor = false ;
7575 let isDirty = false ;
7676
77- // Figure out if we are in a diff editor and if so, which side
78- const [ tab ] = getVisibleTabs ( uri ) ;
79- if ( tab != null ) {
80- isDirty = tab . isDirty ;
81-
82- const uris = getTabUris ( tab ) ;
83- // If there is an original, then we are in a diff editor -- modified is right, original is left
84- if ( uris . original != null && uriEquals ( uri , uris . modified ) ) {
85- isInRightSideOfDiffEditor = true ;
77+ if ( args . commit == null ) {
78+ // Figure out if we are in a diff editor and if so, which side
79+ const [ tab ] = getVisibleTabs ( uri ) ;
80+ if ( tab != null ) {
81+ isDirty = tab . isDirty ;
82+
83+ const uris = getTabUris ( tab ) ;
84+ // If there is an original, then we are in a diff editor -- modified is right, original is left
85+ if ( uris . original != null && uriEquals ( uri , uris . modified ) ) {
86+ isInRightSideOfDiffEditor = true ;
87+ }
8688 }
8789 }
8890
You can’t perform that action at this time.
0 commit comments