From 2b5802ead34af39a5786ce6dba92949793ee52f7 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Thu, 3 Oct 2024 21:20:10 +0200 Subject: working opening editor, need more sophisticated handling of file and args --- src/frontend/handler.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/frontend/handler.rs') 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(); -- cgit v1.2.3