Skip to content

Commit 4672fa1

Browse files
committed
Fix application of composition to multiple cursors
FIX: Fix a bug that broke insertion of composed input at multiple cursors when the IME keeps the selection at the start of the composed text. Closes codemirror/dev#1637
1 parent 6727e32 commit 4672fa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/domchange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function applyDefaultInsert(view: EditorView, change: {from: number, to: number,
209209
let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : undefined
210210
// Try to apply a composition change to all cursors
211211
if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 &&
212-
change.to <= sel.to && change.to >= sel.to - 10) {
212+
change.to <= sel.to + 10 && change.to >= sel.to - 10) {
213213
let replaced = view.state.sliceDoc(change.from, change.to)
214214
let compositionRange: {from: number, to: number}, composition = newSel && findCompositionNode(view, newSel.main.head)
215215
if (composition) {

0 commit comments

Comments
 (0)