File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/vs/editor/browser/widget Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,30 @@ export function findFocusedDiffEditor(accessor: ServicesAccessor): IDiffEditor |
90
90
return diffEditor ;
91
91
}
92
92
}
93
+
94
+ if ( document . activeElement ) {
95
+ for ( const d of diffEditors ) {
96
+ const container = d . getContainerDomNode ( ) ;
97
+ if ( isElementOrParentOf ( container , document . activeElement ) ) {
98
+ return d ;
99
+ }
100
+ }
101
+ }
102
+
93
103
return null ;
94
104
}
95
105
106
+ function isElementOrParentOf ( elementOrParent : Element , element : Element ) : boolean {
107
+ let e : Element | null = element ;
108
+ while ( e ) {
109
+ if ( e === elementOrParent ) {
110
+ return true ;
111
+ }
112
+ e = e . parentElement ;
113
+ }
114
+ return false ;
115
+ }
116
+
96
117
CommandsRegistry . registerCommandAlias ( 'editor.action.diffReview.next' , AccessibleDiffViewerNext . id ) ;
97
118
registerAction2 ( AccessibleDiffViewerNext ) ;
98
119
You can’t perform that action at this time.
0 commit comments