Skip to content

Commit 00cf19f

Browse files
authored
revert 9bfd58f (#252)
causes Word issue; unnecessary since 5ffb9bf
1 parent 4faab0a commit 00cf19f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

macosfrontend/macosfrontend.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ public func commitAndSetPreeditSync(
4848
// is both processed by IM and passed to client in iTerm, so we force a
4949
// dummy client preedit here.
5050
// Some apps also need it to get accurate cursor position to place candidate window.
51-
// But when there is selected text, we don't want the dummy preedit to clear all of
52-
// them. An example is using Shift+click to select but IM switch happens.
53-
if preedit.isEmpty && dummyPreedit && client.selectedRange().length == 0 {
51+
// This is fine even when there is selected text. In Word, not using dummy preedit to
52+
// replace selected text will let Esc bypass IM. When using Shift+click to select, if
53+
// interval is too little, IM switch happens, but dummyPreedit is false in that case.
54+
if preedit.isEmpty && dummyPreedit {
5455
setPreedit(client, zeroWidthSpace, 0)
5556
} else {
5657
setPreedit(client, preedit, cursorPos)

0 commit comments

Comments
 (0)