mirror of
https://git.meli.delivery/meli/meli
synced 2024-10-30 21:20:34 +00:00
Add deleting in ex mode
This commit is contained in:
parent
c30f77a312
commit
f16fd889e4
@ -171,11 +171,10 @@ fn main() {
|
||||
state.rcv_event(UIEvent { id: 0, event_type: UIEventType::ChangeMode(UIMode::Normal)});
|
||||
state.redraw();
|
||||
},
|
||||
k @ Key::Char(_) => {
|
||||
k => {
|
||||
state.rcv_event(UIEvent { id: 0, event_type: UIEventType::ExInput(k)});
|
||||
state.redraw();
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
},
|
||||
UIMode::Fork => {
|
||||
|
@ -453,10 +453,12 @@ impl Component for StatusBar {
|
||||
match m {
|
||||
UIMode::Normal => {
|
||||
self.height = 1;
|
||||
context.replies.push_back(UIEvent {
|
||||
id: 0,
|
||||
event_type: UIEventType::Command(self.ex_buffer.clone()),
|
||||
});
|
||||
if !self.ex_buffer.is_empty() {
|
||||
context.replies.push_back(UIEvent {
|
||||
id: 0,
|
||||
event_type: UIEventType::Command(self.ex_buffer.clone()),
|
||||
});
|
||||
}
|
||||
self.ex_buffer.clear()
|
||||
}
|
||||
UIMode::Execute => {
|
||||
@ -469,6 +471,14 @@ impl Component for StatusBar {
|
||||
self.dirty = true;
|
||||
self.ex_buffer.push(*c);
|
||||
}
|
||||
UIEventType::ExInput(Key::Ctrl('u')) => {
|
||||
self.dirty = true;
|
||||
self.ex_buffer.clear();
|
||||
}
|
||||
UIEventType::ExInput(Key::Backspace) | UIEventType::ExInput(Key::Ctrl('h')) => {
|
||||
self.dirty = true;
|
||||
self.ex_buffer.pop();
|
||||
}
|
||||
UIEventType::Resize => {
|
||||
self.dirty = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user