diff options
| author | lukeflo | 2024-10-03 21:20:10 +0200 |
|---|---|---|
| committer | lukeflo | 2024-10-03 21:20:10 +0200 |
| commit | 2b5802ead34af39a5786ce6dba92949793ee52f7 (patch) | |
| tree | 215b5d258a67c3679896d2356ed909ba29ad23e3 /src/frontend/handler.rs | |
| parent | 9617e3ab4df8bce42ce529685deed9e144654c88 (diff) | |
| download | bibiman-2b5802ead34af39a5786ce6dba92949793ee52f7.tar.gz bibiman-2b5802ead34af39a5786ce6dba92949793ee52f7.zip | |
working opening editor, need more sophisticated handling of file and args
Diffstat (limited to 'src/frontend/handler.rs')
| -rw-r--r-- | src/frontend/handler.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frontend/handler.rs b/src/frontend/handler.rs index 99eaa8e..a718a87 100644 --- a/src/frontend/handler.rs +++ b/src/frontend/handler.rs @@ -16,13 +16,14 @@ ///// use crate::frontend::app::App; +use crate::frontend::tui::Tui; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use super::app::CurrentArea; use color_eyre::eyre::Result; /// Handles the key events and updates the state of [`App`]. -pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> Result<()> { +pub fn handle_key_events(key_event: KeyEvent, app: &mut App, tui: &mut Tui) -> Result<()> { // Keycodes activated for every area (high priority) match key_event.code { // Exit application on `ESC` or `q` @@ -96,7 +97,7 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> Result<()> { App::yank_text(&app.get_selected_citekey()); } KeyCode::Char('e') => { - app.run_editor()?; + app.run_editor(tui)?; } KeyCode::Char('/') => { app.enter_search_area(); |
