statusbar: delete num buffer chars with Backspace

Manos Pitsidianakis 2020-10-20 15:09:00 +03:00
parent 126ed8a189
commit 9f39a7c5a1
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 9 additions and 0 deletions

View File

@ -1229,6 +1229,15 @@ impl Component for Listing {
self.get_status(context),
)));
}
UIEvent::Input(Key::Backspace) if !self.cmd_buf.is_empty() => {
self.cmd_buf.pop();
context
.replies
.push_back(UIEvent::StatusEvent(StatusEvent::BufSet(
self.cmd_buf.clone(),
)));
return true;
}
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt('')) if !self.cmd_buf.is_empty() => {
self.cmd_buf.clear();
self.component.set_command_modifier(false);