@@ -6,7 +6,7 @@ use crossterm::event::Event;
6use helix_core::Position;
6use helix_core::Position;
7use tui::{buffer::Buffer as Surface, layout::Rect};
7use tui::{buffer::Buffer as Surface, layout::Rect};
9−pub type Callback = Box<dyn FnOnce(&mut Compositor, &mut Editor)>;
9+pub type Callback = Box<dyn FnOnce(&mut Compositor)>;
11// --> EventResult should have a callback that takes a context with methods like .popup(),
11// --> EventResult should have a callback that takes a context with methods like .popup(),
12// .prompt() etc. That way we can abstract it from the renderer.
12// .prompt() etc. That way we can abstract it from the renderer.
@@ -22,7 +22,7 @@ pub enum EventResult {
22 Consumed(Option<Callback>),
22 Consumed(Option<Callback>),
25−use helix_view::{Editor, View};
25+use helix_view::Editor;
27use crate::application::LspCallbacks;
27use crate::application::LspCallbacks;
@@ -111,7 +111,7 @@ impl Compositor {
111 for layer in self.layers.iter_mut().rev() {
111 for layer in self.layers.iter_mut().rev() {
112 match layer.handle_event(event, cx) {
112 match layer.handle_event(event, cx) {
113 EventResult::Consumed(Some(callback)) => {
113 EventResult::Consumed(Some(callback)) => {
114− callback(self, cx.editor);
114+ callback(self);
115 return true;
115 return true;
117 EventResult::Consumed(None) => return true,
117 EventResult::Consumed(None) => return true,