Use bracketed paste only for multi-char IME input

Some IME setups do only `commit` single char input, like fcitx5 when
doing ru input.
This commit is contained in:
Kirill Chibisov 2023-07-20 08:21:47 +00:00 committed by GitHub
parent 52a004cce4
commit 044d922601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1342,7 +1342,8 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
WindowEvent::Ime(ime) => match ime {
Ime::Commit(text) => {
*self.ctx.dirty = true;
self.ctx.paste(&text, true);
// Don't use bracketed paste for single char input.
self.ctx.paste(&text, text.chars().count() > 1);
self.ctx.update_cursor_blinking();
},
Ime::Preedit(text, cursor_offset) => {