KeyHandler // Commit buffer on calling the symbol menu.
- Otherwise, the buffer content will be duplicated (a misbehavior) when pressing ESC to exit the symbol menu.
This commit is contained in:
parent
1ee15ac800
commit
a5b5a04a24
|
@ -509,8 +509,10 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot";
|
||||||
|
|
||||||
// MARK: Punctuation list
|
// MARK: Punctuation list
|
||||||
if ([input isSymbolMenuKey]) {
|
if ([input isSymbolMenuKey]) {
|
||||||
InputStateEmpty *empty = [[InputStateEmpty alloc] init];
|
|
||||||
stateCallback(empty);
|
// 得在這裡先 commit buffer,不然會導致「在摁 ESC 離開符號選單時會重複輸入上一次的組字區的內容」的不當行為。
|
||||||
|
// 於是這裡用「模擬一次 Enter 鍵的操作」使其代為執行這個 commit buffer 的動作。
|
||||||
|
[self _handleEnterWithState:state stateCallback:stateCallback errorCallback:errorCallback];
|
||||||
|
|
||||||
SymbolNode *root = [SymbolNode root];
|
SymbolNode *root = [SymbolNode root];
|
||||||
InputStateSymbolTable *symbolState = [[InputStateSymbolTable alloc] initWithNode:root useVerticalMode:input.useVerticalMode];
|
InputStateSymbolTable *symbolState = [[InputStateSymbolTable alloc] initWithNode:root useVerticalMode:input.useVerticalMode];
|
||||||
|
|
Loading…
Reference in New Issue