Skip to content

Commit

Permalink
🚸 Draw UI in every case
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Jul 15, 2024
1 parent cebf718 commit e1924a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions rime-ime
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ zstyle -s ':rime:ui' prompt-len prompt_len ||
prompt_len=2

draw-ui() {
rime-process-key $rime_session_id "$@" || LBUFFER+="$@"
rime getContext $rime_session_id context_composition context_menu context_menu_candidates_text context_menu_candidates_comment
if (( $#context_menu_candidates_text == 0 )) && rime commitComposition $rime_session_id; then
rime getCommit $rime_session_id commit
Expand Down Expand Up @@ -66,18 +65,17 @@ draw-ui() {
}

self-insert() {
rime-process-key $rime_session_id "$KEYS" || LBUFFER+="$KEYS"
draw-ui $KEYS
}

draw-ui-when-preedit() {
if [[ -n $preedit ]]; then
draw-ui $KEYS
elif [[ $KEYS == ' ' ]]; then
# FIXME: autopair-insert cannot work
LBUFFER+=' '
rime-process-key $rime_session_id "$KEYS" || LBUFFER+="$KEYS"
else
zle ${"$(bindkey -M main "$KEYS")"##* }
fi
draw-ui $KEYS
}

zle -N self-insert
Expand Down

0 comments on commit e1924a6

Please sign in to comment.