Skip to content

Commit f998308

Browse files
committed
fix(input): use NSString length for marked selection
1 parent b4a9ffd commit f998308

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Source/InputMethodController.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,13 @@ extension McBopomofoInputMethodController {
623623
}
624624

625625
client.setMarkedText(
626-
state.composingBuffer, selectionRange: NSMakeRange(state.composingBuffer.count, 0),
627-
replacementRange: NSMakeRange(NSNotFound, NSNotFound))
626+
state.composingBuffer,
627+
selectionRange: NSMakeRange(
628+
(state.composingBuffer as NSString).length,
629+
0
630+
),
631+
replacementRange: NSMakeRange(NSNotFound, NSNotFound)
632+
)
628633
if state.candidateCount > 0 {
629634
show(candidateWindowWith: state, client: client)
630635
}

0 commit comments

Comments
 (0)