mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-12 11:39:57 +01:00
@@ -90,9 +90,30 @@ export function findFocusedDiffEditor(accessor: ServicesAccessor): IDiffEditor |
|
||||
return diffEditor;
|
||||
}
|
||||
}
|
||||
|
||||
if (document.activeElement) {
|
||||
for (const d of diffEditors) {
|
||||
const container = d.getContainerDomNode();
|
||||
if (isElementOrParentOf(container, document.activeElement)) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function isElementOrParentOf(elementOrParent: Element, element: Element): boolean {
|
||||
let e: Element | null = element;
|
||||
while (e) {
|
||||
if (e === elementOrParent) {
|
||||
return true;
|
||||
}
|
||||
e = e.parentElement;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CommandsRegistry.registerCommandAlias('editor.action.diffReview.next', AccessibleDiffViewerNext.id);
|
||||
registerAction2(AccessibleDiffViewerNext);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user