diff options
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input.rs b/src/input.rs index 07887ad9..23ccdd58 100644 --- a/src/input.rs +++ b/src/input.rs @@ -687,16 +687,16 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { self.ctx.clear_selection(); let utf8_len = c.len_utf8(); - if *self.ctx.received_count() == 0 && self.ctx.last_modifiers().alt && utf8_len == 1 { - self.ctx.write_to_pty(b"\x1b".to_vec()); - } - let mut bytes = Vec::with_capacity(utf8_len); unsafe { bytes.set_len(utf8_len); c.encode_utf8(&mut bytes[..]); } + if *self.ctx.received_count() == 0 && self.ctx.last_modifiers().alt && utf8_len == 1 { + bytes.insert(0, b'\x1b'); + } + self.ctx.write_to_pty(bytes); *self.ctx.received_count() += 1; |