This commit is contained in:
Henning Dieterichs
2023-07-28 12:23:25 +02:00
committed by GitHub
parent fc574908af
commit b3ebdfacb5
@@ -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);