Browse Source

EXECUTE: cancel command with Esc

tags/alpha-0.6.0
Manos Pitsidianakis 8 months ago
parent
commit
b20bdea8f0
Signed by: epilys GPG Key ID: 73627C2F690DF710
2 changed files with 8 additions and 1 deletions
  1. +1
    -1
      src/bin.rs
  2. +7
    -0
      src/components/utilities.rs

+ 1
- 1
src/bin.rs View File

@ -423,7 +423,7 @@ fn run_app(opt: Opt) -> Result<()> {
}
UIMode::Execute => {
match k {
Key::Char('\n') | Key::Esc => {
Key::Char('\n') => {
state.mode = UIMode::Normal;
state.rcv_event(UIEvent::ChangeMode(UIMode::Normal));
state.redraw();

+ 7
- 0
src/components/utilities.rs View File

@ -1148,6 +1148,13 @@ impl Component for StatusBar {
.process_event(&mut UIEvent::InsertInput(k.clone()), context);
return true;
}
UIEvent::ExInput(Key::Esc) => {
self.ex_buffer.clear();
context
.replies
.push_back(UIEvent::ChangeMode(UIMode::Normal));
return true;
}
UIEvent::Resize => {
self.dirty = true;
}

Loading…
Cancel
Save