Zonble: UPR265 to let Shift+Space commit current comp. buffer.

This commit is contained in:
ShikiSuen 2022-02-01 14:09:33 +08:00
parent e7dcbe7e91
commit e77f253ed6
1 changed files with 8 additions and 1 deletions

View File

@ -364,7 +364,14 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
// if the spacebar is NOT set to be a selection key
if ([input isShiftHold] || !Preferences.chooseCandidateUsingSpace) {
if (_builder->cursorIndex() >= _builder->length()) {
[self clear];
if ([state isKindOfClass:[InputStateNotEmpty class]]) {
NSString *composingBuffer = [(InputStateNotEmpty *)state composingBuffer];
if ([composingBuffer length]) {
InputStateCommitting *committing = [[InputStateCommitting alloc] initWithPoppedText:composingBuffer];
stateCallback(committing);
}
}
[self clear];
InputStateCommitting *committing = [[InputStateCommitting alloc] initWithPoppedText:@" "];
stateCallback(committing);
InputStateEmpty *empty = [[InputStateEmpty alloc] init];