Skip to content

Commit

Permalink
selector shouldn't consum up and down entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed Feb 20, 2021
1 parent 4114f88 commit dc84898
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/rime/gear/selector.cc
Expand Up @@ -65,20 +65,29 @@ ProcessResult Selector::ProcessKeyEvent(const KeyEvent& key_event) {
return kAccepted;
}
if (ch == XK_Up || ch == XK_KP_Up) {
if (next_candidate == kDirectionDown) {
CursorUp(ctx);
} else if (next_page == kDirectionDown) {
PageUp(ctx);
if (ctx->caret_pos() == ctx->input().length()) {
if (next_candidate == kDirectionDown &&
CursorUp(ctx)) {
return kAccepted;
}
if (next_page == kDirectionDown) {
PageUp(ctx);
return kAccepted;
}
}
return kAccepted;
return kNoop;
}
if (ch == XK_Down || ch == XK_KP_Down) {
if (next_candidate == kDirectionDown) {
CursorDown(ctx);
} else if (next_page == kDirectionDown) {
PageDown(ctx);
if (ctx->caret_pos() == ctx->input().length()) {
if (next_candidate == kDirectionDown) {
CursorDown(ctx);
return kAccepted;
} else if (next_page == kDirectionDown) {
PageDown(ctx);
return kAccepted;
}
}
return kAccepted;
return kNoop;
}
if (ch == XK_Left || ch == XK_KP_Left) {
if (!key_event.ctrl() &&
Expand Down

0 comments on commit dc84898

Please sign in to comment.