mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
notebook: fix unused cell lookup and broken selection deduplication (#305105)
notebook: remove dead code, fix redundant output search, and fix broken selection dedup Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
This commit is contained in:
@@ -3058,20 +3058,20 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
||||
return;
|
||||
}
|
||||
|
||||
this.viewModel?.viewCells.find(cell => cell.handle === value.cellInfo.cellHandle);
|
||||
const viewIndex = this._list.getViewIndex(cell);
|
||||
|
||||
if (viewIndex === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cell.outputsViewModels.indexOf(key) < 0) {
|
||||
const outputIndex = cell.outputsViewModels.indexOf(key);
|
||||
if (outputIndex < 0) {
|
||||
// output is already gone
|
||||
removedItems.push(key);
|
||||
return;
|
||||
}
|
||||
|
||||
const cellTop = this._list.getCellViewScrollTop(cell);
|
||||
const outputIndex = cell.outputsViewModels.indexOf(key);
|
||||
const outputOffset = cell.getOutputOffset(outputIndex);
|
||||
updateItems.push({
|
||||
cell,
|
||||
|
||||
@@ -159,6 +159,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
|
||||
const handles: number[] = [];
|
||||
cellRangesToIndexes(this._selectionCollection.selections).map(index => index < this.length ? this.cellAt(index) : undefined).forEach(cell => {
|
||||
if (cell && !handlesSet.has(cell.handle)) {
|
||||
handlesSet.add(cell.handle);
|
||||
handles.push(cell.handle);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user