diff options
author | Akshay <[email protected]> | 2021-03-18 05:22:05 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2021-03-18 05:22:05 +0000 |
commit | df95b239e78121ddf4314d47e1c20dad626752fb (patch) | |
tree | 767a36a8f248cdae1c98df330f09c3b6f556c840 /src/app.rs | |
parent | 7615546fb0157c3ec9d2f25ec9837ee0b6cb7e9a (diff) |
add history to command mode
Diffstat (limited to 'src/app.rs')
-rw-r--r-- | src/app.rs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -248,6 +248,7 @@ impl<'ctx> AppState<'ctx> { | |||
248 | } | 248 | } |
249 | 249 | ||
250 | fn eval_command(&mut self) { | 250 | fn eval_command(&mut self) { |
251 | self.command_box.hist_append(); | ||
251 | match self.command_box.text.as_str() { | 252 | match self.command_box.text.as_str() { |
252 | "(save)" => { | 253 | "(save)" => { |
253 | let image = self.export(); | 254 | let image = self.export(); |
@@ -648,7 +649,11 @@ impl<'ctx> AppState<'ctx> { | |||
648 | Keycode::Delete => self.command_box.delete(), | 649 | Keycode::Delete => self.command_box.delete(), |
649 | Keycode::Left => self.command_box.backward(), | 650 | Keycode::Left => self.command_box.backward(), |
650 | Keycode::Right => self.command_box.forward(), | 651 | Keycode::Right => self.command_box.forward(), |
651 | Keycode::Return => self.eval_command(), | 652 | Keycode::Up => self.command_box.hist_prev(), |
653 | Keycode::Down => self.command_box.hist_next(), | ||
654 | Keycode::Return => { | ||
655 | self.eval_command(); | ||
656 | } | ||
652 | Keycode::Escape => { | 657 | Keycode::Escape => { |
653 | self.command_box.clear(); | 658 | self.command_box.clear(); |
654 | self.mode = Mode::Draw; | 659 | self.mode = Mode::Draw; |