allow updating notebook editor selections even if it is not focused.

This commit is contained in:
rebornix 2021-12-13 10:25:26 -08:00
parent 7139b088c8
commit 1c6e70e287
No known key found for this signature in database
GPG key ID: 181FC90D15393C20

View file

@ -412,7 +412,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
// selection change from list view's `setFocus` and `setSelection` should always use `source: view` to prevent events breaking the list view focus/selection change transaction
updateSelectionsState(state: ISelectionState, source: 'view' | 'model' = 'model') {
if (this._focused) {
if (this._focused || source === 'model') {
if (state.kind === SelectionStateType.Handle) {
const primaryIndex = state.primary !== null ? this.getCellIndexByHandle(state.primary) : null;
const primarySelection = primaryIndex !== null ? this.validateRange({ start: primaryIndex, end: primaryIndex + 1 }) : null;