diff --git a/crates/libtiny_tui/src/exit_dialogue.rs b/crates/libtiny_tui/src/exit_dialogue.rs index 1fa7cfdd..6ecfe04c 100644 --- a/crates/libtiny_tui/src/exit_dialogue.rs +++ b/crates/libtiny_tui/src/exit_dialogue.rs @@ -50,7 +50,7 @@ impl ExitDialogue { pub(crate) fn keypressed(&self, key_action: &KeyAction) -> WidgetRet { match key_action { - KeyAction::Input('y') | KeyAction::InputSend => WidgetRet::Quit, + KeyAction::Input('y') | KeyAction::InputSend => WidgetRet::Command("quit".to_string()), _ => WidgetRet::Remove, } } diff --git a/crates/libtiny_tui/src/lib.rs b/crates/libtiny_tui/src/lib.rs index e7ff91a3..11a9db22 100644 --- a/crates/libtiny_tui/src/lib.rs +++ b/crates/libtiny_tui/src/lib.rs @@ -172,12 +172,6 @@ async fn input_handler( Some(Ok(ev)) => { let tui_ret = tui.borrow_mut().handle_input_event(ev, &mut rcv_editor_ret); match tui_ret { - Some(TUIRet::Quit) => { - snd_ev.try_send(Event::Quit { msg: None }).unwrap(); - let _ = snd_abort.try_send(()); - return; - } - Some(TUIRet::KeyCommand { cmd, from }) => { let result = tui.borrow_mut().try_handle_cmd(&cmd, &from); match result { diff --git a/crates/libtiny_tui/src/tui.rs b/crates/libtiny_tui/src/tui.rs index 52257493..000b6cc5 100644 --- a/crates/libtiny_tui/src/tui.rs +++ b/crates/libtiny_tui/src/tui.rs @@ -28,9 +28,6 @@ use termbox_simple::{CellBuf, Termbox}; #[derive(Debug)] pub(crate) enum TUIRet { - /// User wants to quit. - Quit, - /// A command was submitted, either directly, or via a key bound to a command. /// /// `cmd` won't have an initial '/'. @@ -690,8 +687,6 @@ impl TUI { }), WidgetRet::Remove => unimplemented!(), - - WidgetRet::Quit => Some(TUIRet::Quit), } } diff --git a/crates/libtiny_tui/src/widget.rs b/crates/libtiny_tui/src/widget.rs index 051b4a56..666a13c9 100644 --- a/crates/libtiny_tui/src/widget.rs +++ b/crates/libtiny_tui/src/widget.rs @@ -13,7 +13,4 @@ pub(crate) enum WidgetRet { /// Remove the widget. E.g. close the tab, hide the dialogue etc. Remove, - - /// User wants to quit, i.e. pressed `C-c ` or a key bound to the `/quit` command. - Quit, }