Skip to content

Commit

Permalink
Handle preedit clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
kchibisov committed Apr 24, 2022
1 parent 3bbcf21 commit 7488fe4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion alacritty/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,15 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
// This text is being composed, thus should be shown as inline input to
// the user.
Ime::Preedit(text, cursor_range) => {
// If've got empty preedit we should start processing ordinary keyboard
// input.
if text.is_empty() && cursor_range.is_none() {
self.ctx.display.ime_input.clear_preedit()
} else {
self.ctx.display.ime_input.set_preedit(text, cursor_range);
}

*self.ctx.dirty = true;
self.ctx.display.ime_input.set_preedit(text, cursor_range);
},
Ime::Disabled => {
self.ctx.display.ime_input.set_enabled(false);
Expand Down

0 comments on commit 7488fe4

Please sign in to comment.