From 23ee04fffe4bdf4b8c34603e4b191d7cc308051b Mon Sep 17 00:00:00 2001 From: lukeflo Date: Fri, 25 Oct 2024 12:48:19 +0200 Subject: Inegrate new command-action driven structure - Map keys to actions to commands - allows for easily adding config file support - restructure folders/files - implement own input mode - rewrite UI rendering to make it better editable --- src/app.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index 13892af..fe47882 100644 --- a/src/app.rs +++ b/src/app.rs @@ -18,9 +18,9 @@ use crate::bibiman::CurrentArea; // use super::Event; use crate::cliargs::CLIArgs; -use crate::tui::commandnew::{InputCmdAction, OpenRessource}; +use crate::tui::commands::{InputCmdAction, OpenRessource}; use crate::tui::{self, Tui}; -use crate::{bibiman::Bibiman, tui::commandnew::CmdAction}; +use crate::{bibiman::Bibiman, tui::commands::CmdAction}; use color_eyre::eyre::{Ok, Result}; use tui::Event; use tui_input::backend::crossterm::EventHandler; @@ -101,6 +101,7 @@ impl App { pub fn run_command(&mut self, cmd: CmdAction, tui: &mut Tui) -> Result<()> { match cmd { CmdAction::Input(cmd) => match cmd { + InputCmdAction::Nothing => {} InputCmdAction::Handle(event) => { self.input.handle_event(&event); self.bibiman.search_list_by_pattern(&self.input); @@ -111,6 +112,7 @@ impl App { self.bibiman.enter_search_area(); } InputCmdAction::Confirm => { + self.input = Input::default(); self.input_mode = false; // Logic for TABS to be added self.bibiman.confirm_search(); -- cgit v1.2.3