fix Focus/Selection split on delete (#175566)

Fixes #163003
This commit is contained in:
Andrea Mah 2023-02-27 11:06:06 -08:00 committed by GitHub
parent c206c58ad1
commit 0e7a195c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,7 @@ import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/act
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { category, getElementsToOperateOn, getSearchView, shouldRefocus } from 'vs/workbench/contrib/search/browser/searchActionsBase';
import { equals } from 'vs/base/common/arrays';
//#region Interfaces
@ -134,6 +135,8 @@ registerAction2(class RemoveAction extends Action2 {
viewer.setFocus([nextFocusElement], getSelectionKeyboardEvent());
viewer.setSelection([nextFocusElement], getSelectionKeyboardEvent());
}
} else if (!equals(viewer.getFocus(), viewer.getSelection())) {
viewer.setSelection(viewer.getFocus());
}
viewer.domFocus();