fold element should focus the cell.

This commit is contained in:
rebornix 2021-02-22 14:21:11 -08:00
parent 5e067109a3
commit 5428ab54c9
2 changed files with 2 additions and 5 deletions

View file

@ -134,6 +134,7 @@ export class FoldingController extends Disposable implements INotebookEditorCont
}
this.setFoldingStateUp(modelIndex, state === CellFoldingState.Collapsed ? CellFoldingState.Expanded : CellFoldingState.Collapsed, 1);
this._notebookEditor.focusElement(cellViewModel);
}
return;

View file

@ -501,7 +501,7 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
}
const selectionsLeft = [];
this._viewModel!.selectionHandles.forEach(handle => {
this.getSelectedElements().map(el => el.handle).forEach(handle => {
if (this._viewModel!.hasCell(handle)) {
selectionsLeft.push(handle);
}
@ -579,10 +579,6 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
}
selectElement(cell: ICellViewModel) {
if (this._viewModel) {
this._viewModel.selectionHandles = [cell.handle];
}
const index = this._getViewIndexUpperBound(cell);
if (index >= 0) {
this.setSelection([index]);