Better implementation of interrupt on Esc (#2111)

Use existing abstractions
This commit is contained in:
pakrym-oai
2025-08-12 15:43:07 -07:00
committed by GitHub
parent 6c254ca3e7
commit 12cf0dd868
4 changed files with 16 additions and 28 deletions

View File

@@ -1,7 +1,10 @@
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use ratatui::buffer::Buffer;
use ratatui::widgets::WidgetRef;
use crate::app_event_sender::AppEventSender;
use crate::bottom_pane::BottomPane;
use crate::status_indicator_widget::StatusIndicatorWidget;
use super::BottomPaneView;
@@ -40,4 +43,10 @@ impl BottomPaneView<'_> for StatusIndicatorView {
fn render(&self, area: ratatui::layout::Rect, buf: &mut Buffer) {
self.view.render_ref(area, buf);
}
fn handle_key_event(&mut self, _pane: &mut BottomPane<'_>, key_event: KeyEvent) {
if key_event.code == KeyCode::Esc {
self.view.interrupt();
}
}
}