From e1924a6cb28ba7530bd66abf5fd636da7bfe0a39 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Mon, 15 Jul 2024 20:26:22 +0800 Subject: [PATCH] :children_crossing: Draw UI in every case --- rime-ime | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rime-ime b/rime-ime index f814ed0..5aa9fff 100644 --- a/rime-ime +++ b/rime-ime @@ -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 @@ -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