We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9357f45 commit 33d7821Copy full SHA for 33d7821
macosfrontend/macosfrontend.swift
@@ -81,8 +81,7 @@ public func commitAndSetPreeditSync(
81
// For SwiftUI TextField, there is a bug that if caret is at the end of text, zero-width space preedit
82
// spreads from the start to the end, making the whole text underlined. Fortunately, SwiftUI's length
83
// and selectedRange are reliable, so we use a normal space in this case.
84
- if length > 0 && length - currentPreedit.count == selectedRange.location + selectedRange.length
85
- {
+ if length > 0 && length - currentPreedit.count == NSMaxRange(selectedRange) {
86
setPreedit(client, " ", 0)
87
} else {
88
setPreedit(client, zeroWidthSpace, 0)
0 commit comments