aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/compositor.rs
diff options
context:
space:
mode:
authorGokul Soumya2022-08-09 01:31:26 +0000
committerGitHub2022-08-09 01:31:26 +0000
commit634b6d455f064116c609e7cfa1b2b45e51f40029 (patch)
treead06ce4c4f0131d74cc19b6beed000ff043664d8 /helix-term/src/compositor.rs
parent4ce5a94552d887b9b14000dfdd1abe76a6d5f315 (diff)
Add custom event type replacing crossterm's Event (#3169)
Ported over from 61365dfbf3 in the `gui` branch. This will allow adding our own events, most notably an idle timer event (useful for adding debounced input in [dynamic pickers][1] used by interactive global search and workspace symbols). [1]: https://github.com/helix-editor/helix/pull/3110 Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r--helix-term/src/compositor.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index 5548e832..bda38c59 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -4,8 +4,6 @@
use helix_core::Position;
use helix_view::graphics::{CursorKind, Rect};
-use crossterm::event::Event;
-
#[cfg(feature = "integration")]
use tui::backend::TestBackend;
use tui::buffer::Buffer as Surface;
@@ -18,9 +16,10 @@ pub enum EventResult {
Consumed(Option<Callback>),
}
+use crate::job::Jobs;
use helix_view::Editor;
-use crate::job::Jobs;
+pub use helix_view::input::Event;
pub struct Context<'a> {
pub editor: &'a mut Editor,
@@ -161,7 +160,7 @@ impl Compositor {
pub fn handle_event(&mut self, event: Event, cx: &mut Context) -> bool {
// If it is a key event and a macro is being recorded, push the key event to the recording.
if let (Event::Key(key), Some((_, keys))) = (event, &mut cx.editor.macro_recording) {
- keys.push(key.into());
+ keys.push(key);
}
let mut callbacks = Vec::new();