diff --git a/src/y-monaco.js b/src/y-monaco.js index 4ed388f..182786f 100644 --- a/src/y-monaco.js +++ b/src/y-monaco.js @@ -135,18 +135,17 @@ export class MonacoBinding { } else if (op.insert !== undefined) { const pos = monacoModel.getPositionAt(index) const range = new monaco.Selection(pos.lineNumber, pos.column, pos.lineNumber, pos.column) - monacoModel.pushEditOperations([], [{ range, text: op.insert }], () => null) + monacoModel.applyEdits([{ range, text: op.insert }]) index += op.insert.length } else if (op.delete !== undefined) { const pos = monacoModel.getPositionAt(index) const endPos = monacoModel.getPositionAt(index + op.delete) const range = new monaco.Selection(pos.lineNumber, pos.column, endPos.lineNumber, endPos.column) - monacoModel.pushEditOperations([], [{ range, text: '' }], () => null) + monacoModel.applyEdits([{ range, text: '' }]) } else { throw error.unexpectedCase() } }) - monacoModel.pushStackElement() this._savedSelections.forEach((rsel, editor) => { const sel = createMonacoSelectionFromRelativeSelection(editor, ytext, rsel, this.doc) if (sel !== null) {