summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2018-08-07 16:14:06 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-06-10 19:40:27 +0300
commitf16fd889e47caeeb4d52275a057ced5574db90a3 (patch)
treec9f7639d095f5be8cb9bced8f244dc23aacf7fd8 /ui
parentc30f77a312b981c2269c63f12eab5602da1036dd (diff)
Add deleting in ex mode
Diffstat (limited to 'ui')
-rw-r--r--ui/src/components/utilities.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/ui/src/components/utilities.rs b/ui/src/components/utilities.rs
index e41d8826..97a0b623 100644
--- a/ui/src/components/utilities.rs
+++ b/ui/src/components/utilities.rs
@@ -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;
}