KeyHandler // Simplify: _actualCandidateCursorIndex.

This commit is contained in:
ShikiSuen 2022-03-06 14:12:21 +08:00
parent 6c7b798ca2
commit 2778fef5a5
1 changed files with 4 additions and 9 deletions

View File

@ -1429,15 +1429,10 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
- (size_t)_actualCandidateCursorIndex
{
size_t cursorIndex = _builder->cursorIndex();
if (Preferences.selectPhraseAfterCursorAsCandidate) {
// MS Phonetics IME style, phrase is *after* the cursor, i.e. cursor is always *before* the phrase
if (cursorIndex < _builder->length()) {
++cursorIndex;
}
} else {
if (!cursorIndex) {
++cursorIndex;
}
// MS Phonetics IME style, phrase is *after* the cursor, i.e. cursor is always *before* the phrase
if ((Preferences.selectPhraseAfterCursorAsCandidate && (cursorIndex < _builder->length()))
|| !cursorIndex) {
++cursorIndex;
}
return cursorIndex;