Do not hard-code `Typing` as the label for `SingleModelEditStackElement`
parent
780cd3096b
commit
6e0be36443
|
@ -161,11 +161,11 @@ export class SingleModelEditStackElement implements IResourceUndoRedoElement {
|
|||
return this.model.uri;
|
||||
}
|
||||
|
||||
public get label(): string {
|
||||
return nls.localize('edit', "Typing");
|
||||
}
|
||||
|
||||
constructor(model: ITextModel, beforeCursorState: Selection[] | null) {
|
||||
constructor(
|
||||
public readonly label: string,
|
||||
model: ITextModel,
|
||||
beforeCursorState: Selection[] | null
|
||||
) {
|
||||
this.model = model;
|
||||
this._data = SingleModelEditStackData.create(model, beforeCursorState);
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ export class EditStack {
|
|||
if (isEditStackElement(lastElement) && lastElement.canAppend(this._model)) {
|
||||
return lastElement;
|
||||
}
|
||||
const newElement = new SingleModelEditStackElement(this._model, beforeCursorState);
|
||||
const newElement = new SingleModelEditStackElement(nls.localize('edit', "Typing"), this._model, beforeCursorState);
|
||||
this._undoRedoService.pushElement(newElement);
|
||||
return newElement;
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ export class BulkTextEdits {
|
|||
// This edit touches a single model => keep things simple
|
||||
const task = tasks[0];
|
||||
if (!task.isNoOp()) {
|
||||
const singleModelEditStackElement = new SingleModelEditStackElement(task.model, task.getBeforeCursorState());
|
||||
const singleModelEditStackElement = new SingleModelEditStackElement(this._label, task.model, task.getBeforeCursorState());
|
||||
this._undoRedoService.pushElement(singleModelEditStackElement, this._undoRedoGroup, this._undoRedoSource);
|
||||
task.apply();
|
||||
singleModelEditStackElement.close();
|
||||
|
@ -259,7 +259,7 @@ export class BulkTextEdits {
|
|||
// prepare multi model undo element
|
||||
const multiModelEditStackElement = new MultiModelEditStackElement(
|
||||
this._label,
|
||||
tasks.map(t => new SingleModelEditStackElement(t.model, t.getBeforeCursorState()))
|
||||
tasks.map(t => new SingleModelEditStackElement(this._label, t.model, t.getBeforeCursorState()))
|
||||
);
|
||||
this._undoRedoService.pushElement(multiModelEditStackElement, this._undoRedoGroup, this._undoRedoSource);
|
||||
for (const task of tasks) {
|
||||
|
|
Loading…
Reference in New Issue