From be3c02104600e5bba8e3af7bc9787e62cba30183 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 7 Dec 2020 15:18:37 +0900 Subject: snapshot --- helix-term/src/compositor.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'helix-term/src/compositor.rs') diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs index 187c5692..f859f947 100644 --- a/helix-term/src/compositor.rs +++ b/helix-term/src/compositor.rs @@ -18,9 +18,17 @@ use crossterm::event::Event; use smol::Executor; use tui::buffer::Buffer as Surface; +pub(crate) type Callback = Box; + +// Cursive-inspired +pub(crate) enum EventResult { + Ignored, + Consumed(Option), +} + pub(crate) trait Component { /// Process input events, return true if handled. - fn handle_event(&mut self, event: Event, executor: &Executor) -> bool; + fn handle_event(&mut self, event: Event, executor: &Executor) -> EventResult; // , args: () /// Should redraw? Useful for saving redraw cycles if we know component didn't change. -- cgit v1.2.3-70-g09d2