diff options
| author | lukeflo | 2025-02-17 21:43:18 +0100 |
|---|---|---|
| committer | lukeflo | 2025-02-17 21:43:18 +0100 |
| commit | de0e6fcde0f4fdd9a08255dac52629bec28a0ca3 (patch) | |
| tree | 6df6f37849c118c997006487b49ede619002e4e2 /src/app.rs | |
| parent | d443843d352d740b895c4d622eb9af9567aa7423 (diff) | |
| download | bibiman-de0e6fcde0f4fdd9a08255dac52629bec28a0ca3.tar.gz bibiman-de0e6fcde0f4fdd9a08255dac52629bec28a0ca3.zip | |
Update README
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 => { |
