From 24034b80e9d146aeeb28ecfc8e440fdd39370de4 Mon Sep 17 00:00:00 2001 From: qkzk Date: Thu, 11 Jan 2024 22:25:59 +0100 Subject: WIP. May have to be reversed. Should I create a window kind object and send it actions ? --- src/event/event_exec.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/event/event_exec.rs b/src/event/event_exec.rs index 05ac778..b7dcad3 100644 --- a/src/event/event_exec.rs +++ b/src/event/event_exec.rs @@ -1193,8 +1193,15 @@ impl EventAction { /// Enter action mode in which you can type any valid action. /// Some action does nothing as they require to be executed from a specific context. pub fn action(status: &mut Status) -> Result<()> { - status.set_edit_mode(status.index, Edit::InputCompleted(InputCompleted::Action))?; - status.menu.completion.reset(); + if matches!( + status.current_tab().edit_mode, + Edit::InputCompleted(InputCompleted::Action) + ) { + status.reset_edit_mode()?; + } else { + status.set_edit_mode(status.index, Edit::InputCompleted(InputCompleted::Action))?; + status.menu.completion.reset(); + } Ok(()) } -- cgit v1.2.3