KeyHandler // Let Front-Cursor mode select phrase when index == 0.
This commit is contained in:
parent
fd2074b44e
commit
a240da5297
|
@ -74,6 +74,7 @@ struct BufferStatePackage
|
|||
- (BOOL)isPrintable:(UniChar)charCode;
|
||||
- (NSArray<NSString *> *)buildAssociatePhraseArrayWithKey:(NSString *)key;
|
||||
- (NSArray<NSString *> *)getCandidatesArray;
|
||||
- (NSInteger)getKeyLengthAtIndexZero;
|
||||
- (NSInteger)getBuilderCursorIndex;
|
||||
- (NSInteger)getBuilderLength;
|
||||
- (NSInteger)getPackagedCursorIndex;
|
||||
|
|
|
@ -623,6 +623,11 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
|||
return candidatesArray;
|
||||
}
|
||||
|
||||
- (NSInteger)getKeyLengthAtIndexZero
|
||||
{
|
||||
return [NSString stringWithUTF8String:_walkedNodes[0].node->currentKeyValue().value.c_str()].length;
|
||||
}
|
||||
|
||||
#pragma mark - 威注音認為有必要單獨拿出來處理的部分,交給 Swift 則有些困難。
|
||||
|
||||
- (BOOL)isPrintable:(UniChar)charCode
|
||||
|
|
|
@ -41,7 +41,11 @@ import Cocoa
|
|||
&& (cursorIndex < getBuilderLength()))
|
||||
|| cursorIndex == 0
|
||||
{
|
||||
cursorIndex += 1
|
||||
if cursorIndex == 0 && !mgrPrefs.setRearCursorMode {
|
||||
cursorIndex += getKeyLengthAtIndexZero()
|
||||
} else {
|
||||
cursorIndex += 1
|
||||
}
|
||||
}
|
||||
return cursorIndex
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue