summaryrefslogtreecommitdiff
path: root/helix-term/src/ui/picker.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/ui/picker.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/ui/picker.rs')
-rw-r--r--helix-term/src/ui/picker.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index 9707c81e..169aeadd 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -1,9 +1,8 @@
use crate::{
- compositor::{Component, Compositor, Context, EventResult},
+ compositor::{Component, Compositor, Context, Event, EventResult},
ctrl, key, shift,
ui::{self, EditorView},
};
-use crossterm::event::Event;
use tui::{
buffer::Buffer as Surface,
widgets::{Block, BorderType, Borders},
@@ -502,7 +501,7 @@ impl<T: Item + 'static> Component for Picker<T> {
compositor.last_picker = compositor.pop();
})));
- match key_event.into() {
+ match key_event {
shift!(Tab) | key!(Up) | ctrl!('p') => {
self.move_by(1, Direction::Backward);
}