selections[0] is primary.

This commit is contained in:
rebornix
2021-02-22 10:16:57 -08:00
parent e427e5280c
commit ed08a14111
14 changed files with 53 additions and 36 deletions

View File

@@ -175,8 +175,9 @@ export class ExtHostNotebookEditor {
this._visibleRanges = value;
}
_acceptSelections(primary: number | null, selections: ICellRange[]): void {
this._selection = primary !== null ? this.notebookData.getCellFromIndex(primary)?.cell : undefined;
_acceptSelections(selections: ICellRange[]): void {
const primarySelection = selections[0];
this._selection = primarySelection ? this.notebookData.getCellFromIndex(primarySelection.start)?.cell : undefined;
this._selections = selections.map(val => new extHostTypes.NotebookCellRange(val.start, val.end));
}