mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-25 15:35:43 +01:00
re #118108. separate selection and focus.
This commit is contained in:
@@ -963,9 +963,14 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
|
||||
// todo@rebornix https://github.com/microsoft/vscode/issues/118108 support selections not just focus
|
||||
// todo@rebornix support multipe selections
|
||||
if (options?.cellSelections && this.viewModel) {
|
||||
const focusedCell = this.viewModel.viewCells[options.cellSelections[0].start];
|
||||
const focusCellIndex = options.cellSelections[0].start;
|
||||
const focusedCell = this.viewModel.viewCells[focusCellIndex];
|
||||
this.viewModel.updateSelectionsState({
|
||||
kind: SelectionStateType.Index,
|
||||
focus: { start: focusCellIndex, end: focusCellIndex + 1 },
|
||||
selections: options.cellSelections
|
||||
});
|
||||
this.revealInCenterIfOutsideViewport(focusedCell);
|
||||
this.focusElement(focusedCell);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user