1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-21 03:39:16 +03:00

remove host from key_down signature

This commit is contained in:
Wez Furlong 2019-03-02 08:54:10 -08:00
parent 8f13e53ac8
commit 5565ccd30e
3 changed files with 6 additions and 18 deletions

View File

@ -635,11 +635,7 @@ impl GliumTerminalWindow {
return Ok(());
}
tab.terminal().key_down(
key,
mods,
&mut TabHost::new(&mut tab.pty(), &mut self.host),
)?
tab.terminal().key_down(key, mods, &mut *tab.pty())?
}
ElementState::Released => tab.terminal().key_up(
@ -699,7 +695,7 @@ impl GliumTerminalWindow {
tab.terminal().key_down(
KeyCode::Char(c),
self.last_modifiers,
&mut TabHost::new(&mut tab.pty(), &mut self.host),
&mut *tab.pty(),
)?;
self.paint_if_needed()?;
}

View File

@ -241,11 +241,7 @@ impl X11TerminalWindow {
return Ok(());
}
tab.terminal().key_down(
code,
mods,
&mut TabHost::new(&mut tab.pty(), &mut self.host),
)?;
tab.terminal().key_down(code, mods, &mut *tab.pty())?;
}
}
xcb::KEY_RELEASE => {

View File

@ -601,7 +601,7 @@ impl TerminalState {
)?;
} else if self.screen.is_alt_screen_active() {
// Send cursor keys instead (equivalent to xterm's alternateScroll mode)
self.key_down(key, KeyModifiers::default(), host)?;
self.key_down(key, KeyModifiers::default(), host.writer())?;
} else {
self.scroll_viewport(scroll_delta)
}
@ -692,7 +692,7 @@ impl TerminalState {
&mut self,
key: KeyCode,
mods: KeyModifiers,
host: &mut TerminalHost,
writer: &mut std::io::Write,
) -> Result<(), Error> {
const CTRL: KeyModifiers = KeyModifiers::CTRL;
const SHIFT: KeyModifiers = KeyModifiers::SHIFT;
@ -710,10 +710,6 @@ impl TerminalState {
// TODO: also respect self.application_keypad
let to_send = match (key, ctrl, alt, shift, self.application_cursor_keys) {
(Enter, _, ALT, ..) | (Char('\r'), _, ALT, ..) | (Char('\n'), _, ALT, ..) => {
host.toggle_full_screen();
return Ok(());
}
(Tab, ..) => "\t",
(Enter, ..) => "\r",
(Backspace, ..) => "\x08",
@ -858,7 +854,7 @@ impl TerminalState {
};
// eprintln!("sending {:?}", to_send);
write_all(host.writer(), to_send.as_bytes())?;
write_all(writer, to_send.as_bytes())?;
// Reset the viewport if we sent data to the parser
if !to_send.is_empty() && self.viewport_offset != 0 {