aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorlukeflo2024-10-25 12:48:19 +0200
committerlukeflo2024-10-25 12:48:19 +0200
commit23ee04fffe4bdf4b8c34603e4b191d7cc308051b (patch)
tree70e4b146e388067dec7e4d5d1c5b8cd3628b5e4a /src/app.rs
parentbc4513d700b724b8edb72b6a1a429df60967a12c (diff)
downloadbibiman-23ee04fffe4bdf4b8c34603e4b191d7cc308051b.tar.gz
bibiman-23ee04fffe4bdf4b8c34603e4b191d7cc308051b.zip
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
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs6
1 files changed, 4 insertions, 2 deletions
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();