chewing / libchewing

libchewing - The intelligent phonetic input method library
https://chewing.im/
GNU Lesser General Public License v2.1
357 stars 89 forks source link

Add an API for IME to signal they have handled output #500

Closed kanru closed 1 week ago

kanru commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently APIs like chewing_buffer_String() and chewing_commit_String() will return the same data every time until next keystroke. To avoid output string repeatedly or display stale data IMEs have to remember that there was no new input.

Describe the solution you'd like

Provide an API to mark commit string handled to clear commit buffer

Describe alternatives you've considered

Automatically clear commit buffer after read. This is a breaking change.

Additional context

https://github.com/chewing/ibus-chewing/blob/fdd08f4f79f38e3f4c1957926f4f174dae8692e3/src/IBusChewingPreEdit.c#L69-L72