Skip to content

Commit baba378

Browse files
committed
remove optional param for notebook applyedits.
1 parent 24f6cc6 commit baba378

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/vs/workbench/contrib/notebook/browser/controller/cellOperations.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function runDeleteAction(editor: IActiveNotebookEditor, cell: ICellViewMo
143143
return { kind: SelectionStateType.Index, focus: { start: 0, end: 0 }, selections: [{ start: 0, end: 0 }] };
144144
}
145145
}
146-
}, undefined);
146+
}, undefined, true);
147147
} else {
148148
const focus = editor.getFocus();
149149
const edits: ICellReplaceEdit[] = [{
@@ -169,14 +169,14 @@ export function runDeleteAction(editor: IActiveNotebookEditor, cell: ICellViewMo
169169

170170
textModel.applyEdits(edits, true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: editor.getSelections() }, () => ({
171171
kind: SelectionStateType.Index, focus: newFocus, selections: finalSelections
172-
}), undefined);
172+
}), undefined, true);
173173
} else {
174174
// users decide to delete a cell out of current focus/selection
175175
const newFocus = focus.start > targetCellIndex ? { start: focus.start - 1, end: focus.end - 1 } : focus;
176176

177177
textModel.applyEdits(edits, true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: editor.getSelections() }, () => ({
178178
kind: SelectionStateType.Index, focus: newFocus, selections: finalSelections
179-
}), undefined);
179+
}), undefined, true);
180180
}
181181
}
182182
}
@@ -222,7 +222,8 @@ export async function moveCellRange(context: INotebookCellActionContext, directi
222222
selections: editor.getSelections()
223223
},
224224
() => ({ kind: SelectionStateType.Index, focus: newFocus, selections: [finalSelection] }),
225-
undefined
225+
undefined,
226+
true
226227
);
227228
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
228229
editor.revealCellRangeInView(focusRange);
@@ -250,7 +251,8 @@ export async function moveCellRange(context: INotebookCellActionContext, directi
250251
selections: editor.getSelections()
251252
},
252253
() => ({ kind: SelectionStateType.Index, focus: newFocus, selections: [finalSelection] }),
253-
undefined
254+
undefined,
255+
true
254256
);
255257

256258
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
@@ -304,7 +306,8 @@ export async function copyCellRange(context: INotebookCellActionContext, directi
304306
selections: selections
305307
},
306308
() => ({ kind: SelectionStateType.Index, focus: focus, selections: selections }),
307-
undefined
309+
undefined,
310+
true
308311
);
309312
} else {
310313
// insert down, move selections
@@ -328,7 +331,8 @@ export async function copyCellRange(context: INotebookCellActionContext, directi
328331
selections: selections
329332
},
330333
() => ({ kind: SelectionStateType.Index, focus: newFocus, selections: newSelections }),
331-
undefined
334+
undefined,
335+
true
332336
);
333337

334338
const focusRange = editor.getSelections()[0] ?? editor.getFocus();

src/vs/workbench/contrib/notebook/common/model/notebookTextModel.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,12 @@ export class NotebookTextModel extends Disposable implements INotebookTextModel
399399
],
400400
true,
401401
undefined, () => undefined,
402-
undefined
402+
undefined,
403+
true
403404
);
404405
}
405406

406-
applyEdits(rawEdits: ICellEditOperation[], synchronous: boolean, beginSelectionState: ISelectionState | undefined, endSelectionsComputer: () => ISelectionState | undefined, undoRedoGroup: UndoRedoGroup | undefined, computeUndoRedo: boolean = true): boolean {
407+
applyEdits(rawEdits: ICellEditOperation[], synchronous: boolean, beginSelectionState: ISelectionState | undefined, endSelectionsComputer: () => ISelectionState | undefined, undoRedoGroup: UndoRedoGroup | undefined, computeUndoRedo: boolean): boolean {
407408
this._pauseableEmitter.pause();
408409
this.pushStackElement('edit', beginSelectionState, undoRedoGroup);
409410

0 commit comments

Comments
 (0)