Skip to content

Commit

Permalink
Merge branch 'raedle-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Jan 8, 2021
2 parents 577f4ae + 46693f1 commit 800420f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/y-monaco.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 800420f

Please sign in to comment.