rime / librime

Rime Input Method Engine, the core library
https://rime.im
BSD 3-Clause "New" or "Revised" License
3.37k stars 551 forks source link

echo_translator returns a empty candidate when press {escape} after committing part of input codes #836

Closed mirtlecn closed 7 months ago

mirtlecn commented 7 months ago

Describe the bug

{Escape} will clear all committed text and reset current state to no composing if input codes exist but user selects nothing.

But, if there are input codes with selected cands, {Escape} will clear the codes and remain current state as composing, in which case, echo_translator will return a null cand.

1709562879

To Reproduce Steps to reproduce the bug:

  1. enable echo_translator
  2. send nihao
  3. select ni -> , then the committed code will be 你hao
  4. send {Escape}
  5. there is a null cand being highlighted

video:

20240120202731.webm

Expected behavior

Either

{Escape} will always clear all commited texts by default.

or

echo_translator will not echo a null cand

Even if retaining committed candidate is an intended behaviour, it's quite comfusing that echo_translator returning a empty candidate. There is only a lable 1 in the weasel window as the above gif shows.

is accepted.

Flavor(please complete the following information): Select your flavor:

Package:

lotem commented 7 months ago

Fixed in https://github.com/rime/librime/commit/ec4bdfe4b9937f790417e8a3aec006d4c5d6dd85