Remove the prompt on ESC.
This commit is contained in:
parent
7dc24a25ba
commit
07801b60bc
1 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::compositor::{Component, Context, EventResult};
|
||||
use crate::compositor::{Component, Compositor, Context, EventResult};
|
||||
use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
|
||||
use helix_core::Position;
|
||||
use helix_view::Editor;
|
||||
|
@ -161,7 +161,12 @@ impl Component for Prompt {
|
|||
} => self.insert_char(c),
|
||||
KeyEvent {
|
||||
code: KeyCode::Esc, ..
|
||||
} => self.should_close = true,
|
||||
} => {
|
||||
return EventResult::Consumed(Some(Box::new(|compositor: &mut Compositor| {
|
||||
// remove the layer
|
||||
compositor.pop();
|
||||
})));
|
||||
}
|
||||
KeyEvent {
|
||||
code: KeyCode::Right,
|
||||
..
|
||||
|
|
Loading…
Add table
Reference in a new issue