Skip to content

Commit

Permalink
Fix handling of IME::Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kchibisov committed Mar 23, 2022
1 parent 49bfc78 commit fc0a825
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 11 deletions.
129 changes: 119 additions & 10 deletions Cargo.lock

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

7 changes: 6 additions & 1 deletion alacritty/src/display/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,12 @@ impl ImeInput {

#[inline]
pub fn set_enabled(&mut self, is_enabled: bool) {
self.is_enabled = is_enabled;
if !is_enabled {
// Clear state when disabling input method.
*self = Default::default();
} else {
self.is_enabled = true;
}
}

#[inline]
Expand Down
5 changes: 5 additions & 0 deletions alacritty/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,12 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
let num_cols = self.ctx.terminal.columns() as u32 - 1;
self.ctx.display.damage_from_point(point, num_cols);
}

// Don't suppress chars for commit.
let mut suppress = false;
mem::swap(self.ctx.suppress_chars, &mut suppress);
text.chars().for_each(|ch| self.received_char(ch));
*self.ctx.suppress_chars = suppress;
},
// This text is being composed, thus should be shown as inline input to
// the user.
Expand Down

0 comments on commit fc0a825

Please sign in to comment.