diff options
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -60,7 +60,7 @@ impl App { }) } - pub async fn run(&mut self, args: &mut CLIArgs) -> Result<()> { + pub async fn run(&mut self, args: &mut CLIArgs, cfg: &BibiConfig) -> Result<()> { let mut tui = tui::Tui::new()?; tui.enter()?; @@ -86,10 +86,10 @@ impl App { } else { CmdAction::from(key_event) }; - self.run_command(command, args, &mut tui)? + self.run_command(command, args, cfg, &mut tui)? } Event::Mouse(mouse_event) => { - self.run_command(CmdAction::from(mouse_event), args, &mut tui)? + self.run_command(CmdAction::from(mouse_event), args, cfg, &mut tui)? } Event::Resize(_, _) => {} @@ -111,7 +111,13 @@ impl App { self.running = false; } - pub fn run_command(&mut self, cmd: CmdAction, args: &mut CLIArgs, tui: &mut Tui) -> Result<()> { + pub fn run_command( + &mut self, + cmd: CmdAction, + args: &mut CLIArgs, + cfg: &BibiConfig, + tui: &mut Tui, + ) -> Result<()> { match cmd { CmdAction::Input(cmd) => match cmd { InputCmdAction::Nothing => {} @@ -304,7 +310,7 @@ impl App { } CmdAction::EditFile => { if let CurrentArea::EntryArea = self.bibiman.current_area { - self.bibiman.run_editor(args, tui)?; + self.bibiman.run_editor(cfg, args, tui)?; } } CmdAction::Open => { |
