diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-03-25 17:22:10 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-03-25 17:22:10 +0000 |
| commit | b6f945da35065f0a0d3b384b4d0f167908c0140f (patch) | |
| tree | 2fe792360569c829ca4bdd2c66f3a6a9e0748e7f /src/common/input | |
| parent | Converted tab updates to the new generic update() function (diff) | |
| download | sl0ppij-b6f945da35065f0a0d3b384b4d0f167908c0140f.tar.gz sl0ppij-b6f945da35065f0a0d3b384b4d0f167908c0140f.tar.xz sl0ppij-b6f945da35065f0a0d3b384b4d0f167908c0140f.zip | |
Wrap up the plugin system refactor, running everything through update()
Diffstat (limited to 'src/common/input')
| -rw-r--r-- | src/common/input/actions.rs | 1 | ||||
| -rw-r--r-- | src/common/input/handler.rs | 24 | ||||
| -rw-r--r-- | src/common/input/keybinds.rs | 5 |
3 files changed, 2 insertions, 28 deletions
diff --git a/src/common/input/actions.rs b/src/common/input/actions.rs index 059255d3..f4226864 100644 --- a/src/common/input/actions.rs +++ b/src/common/input/actions.rs @@ -49,5 +49,4 @@ pub enum Action { CloseTab, GoToTab(u32), TabNameInput(Vec<u8>), - SaveTabName, } diff --git a/src/common/input/handler.rs b/src/common/input/handler.rs index 3444471a..33f4e5dc 100644 --- a/src/common/input/handler.rs +++ b/src/common/input/handler.rs @@ -7,7 +7,7 @@ use crate::errors::ContextType; use crate::os_input_output::OsApi; use crate::pty_bus::PtyInstruction; use crate::screen::ScreenInstruction; -use crate::wasm_vm::{NaughtyEventType, PluginInputType, PluginInstruction}; +use crate::wasm_vm::PluginInstruction; use crate::CommandIsExecuting; use termion::input::{TermRead, TermReadEventsAndRaw}; @@ -66,11 +66,6 @@ impl InputHandler { Ok((event, raw_bytes)) => match event { termion::event::Event::Key(key) => { let key = cast_termion_key(key); - // FIXME: This is a bit of a hack to get resizing to work! - drop( - self.send_screen_instructions - .send(ScreenInstruction::Render), - ); // FIXME this explicit break is needed because the current test // framework relies on it to not create dead threads that loop // and eat up CPUs. Do not remove until the test framework has @@ -237,27 +232,10 @@ impl InputHandler { .unwrap(); } Action::TabNameInput(c) => { - self.send_plugin_instructions - .send(PluginInstruction::Input( - PluginInputType::Event(NaughtyEventType::Tab), - c.clone(), - )) - .unwrap(); self.send_screen_instructions .send(ScreenInstruction::UpdateTabName(c)) .unwrap(); } - Action::SaveTabName => { - self.send_plugin_instructions - .send(PluginInstruction::Input( - PluginInputType::Event(NaughtyEventType::Tab), - vec![b'\n'], - )) - .unwrap(); - self.send_screen_instructions - .send(ScreenInstruction::UpdateTabName(vec![b'\n'])) - .unwrap(); - } Action::NoOp => {} } diff --git a/src/common/input/keybinds.rs b/src/common/input/keybinds.rs index e48d3115..7b1e8779 100644 --- a/src/common/input/keybinds.rs +++ b/src/common/input/keybinds.rs @@ -226,10 +226,7 @@ fn get_defaults_for_mode(mode: &InputMode) -> ModeKeybinds { defaults.insert(Key::Up, vec![Action::ScrollUp]); } InputMode::RenameTab => { - defaults.insert( - Key::Char('\n'), - vec![Action::SaveTabName, Action::SwitchToMode(InputMode::Tab)], - ); + defaults.insert(Key::Char('\n'), vec![Action::SwitchToMode(InputMode::Tab)]); defaults.insert( Key::Ctrl('g'), vec![Action::SwitchToMode(InputMode::Normal)], |
