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 |
9090 return diffEditor ;
9191 }
9292 }
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+
93103 return null ;
94104}
95105
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+
96117CommandsRegistry . registerCommandAlias ( 'editor.action.diffReview.next' , AccessibleDiffViewerNext . id ) ;
97118registerAction2 ( AccessibleDiffViewerNext ) ;
98119
You can’t perform that action at this time.
0 commit comments