mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 22:41:31 +01:00
Fixing some index bugs with edits api for custom editors
This commit is contained in:
@@ -673,11 +673,10 @@ class MainThreadCustomEditorModel extends Disposable implements ICustomEditorMod
|
||||
}
|
||||
|
||||
const undoneEdit = this._edits[this._currentEditIndex];
|
||||
await this._proxy.$undo(this._editorResource, this.viewType, undoneEdit, this.getEditState());
|
||||
|
||||
this.change(() => {
|
||||
--this._currentEditIndex;
|
||||
});
|
||||
await this._proxy.$undo(this._editorResource, this.viewType, undoneEdit, this.getEditState());
|
||||
}
|
||||
|
||||
private getEditState(): extHostProtocol.CustomDocumentEditState {
|
||||
@@ -699,10 +698,10 @@ class MainThreadCustomEditorModel extends Disposable implements ICustomEditorMod
|
||||
}
|
||||
|
||||
const redoneEdit = this._edits[this._currentEditIndex + 1];
|
||||
await this._proxy.$redo(this._editorResource, this.viewType, redoneEdit, this.getEditState());
|
||||
this.change(() => {
|
||||
++this._currentEditIndex;
|
||||
});
|
||||
await this._proxy.$redo(this._editorResource, this.viewType, redoneEdit, this.getEditState());
|
||||
}
|
||||
|
||||
private spliceEdits(editToInsert?: number) {
|
||||
|
||||
Reference in New Issue
Block a user