rime / librime

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

Editor's `back_syllable` removes multiple syllables when selecting a shorter candidate #910

Open EtaoinWu opened 1 month ago

EtaoinWu commented 1 month ago

Describe the bug When multiple syllables are typed and the selector is used to select a shorter candidate, this would leave some unused syllables un-highlighted.

Illustration of the bug condition

If the back_syllable action of the editor is invoked, for example by hitting {Control+BackSpace}, all the unhighlighted syllables (in this case shu'ru) are removed, instead of only one of them.

To Reproduce Steps to reproduce the bug:

  1. This should happen also on the default configuration with stock luna_pinyin. I tested this on weasel 0.16.1 and librime 1.11.2.
  2. Type ce'shi'shu'ru.
  3. Use {Down} until you select the word 測試.
  4. Hit {Control+BackSpace} to invoke back_syllable and observe that shu'ru is removed, leaving only ce'shi in the input.

Expected behavior Only one syllable (in our case shi) shall be removed.

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

Package:

ksqsf commented 1 month ago

I think this is intended. Note that the caret is still at the end of the input. If you move the caret after "shi" and then hit Ctrl+BackSpace, it will work as you expect.