Skip to content

Commit f9cbe74

Browse files
committed
Adjust multiple-cursor composition fix for MacOS
FIX: Improve handling of composition with multiple cursors on MacOS. Issue codemirror/dev#1637
1 parent 07b660c commit f9cbe74

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
@@ -208,7 +208,7 @@ function applyDefaultInsert(view: EditorView, change: {from: number, to: number,
208208
let changes = startState.changes(change)
209209
let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : undefined
210210
// Try to apply a composition change to all cursors
211-
if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 &&
211+
if (startState.selection.ranges.length > 1 && (view.inputState.composing >= 0 || view.inputState.compositionPendingChange) &&
212212
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)

0 commit comments

Comments
 (0)