diff options
author | Canop <cano.petrole@gmail.com> | 2021-06-02 15:23:54 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-06-02 15:23:54 +0200 |
commit | 424023b4b084e071ecf67fc719db56ce40a01345 (patch) | |
tree | a077a0431c59a003da6250782617aed3b5a6eec9 /src/command | |
parent | 77f40f74c38392a5213f99006138d74772ac5c6c (diff) |
`:input_clear` internal
Fix #24
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/panel_input.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/command/panel_input.rs b/src/command/panel_input.rs index f13bc90..c810872 100644 --- a/src/command/panel_input.rs +++ b/src/command/panel_input.rs @@ -90,6 +90,14 @@ impl PanelInput { ) -> bool { if let VerbExecution::Internal(internal_exec) = &verb.execution { match internal_exec.internal { + Internal::input_clear => { + if self.input_field.get_content().is_empty() { + false + } else { + self.input_field.set_content(""); + true + } + } Internal::input_del_char_left => self.input_field.del_char_left(), Internal::input_del_char_below => self.input_field.del_char_below(), Internal::input_del_word_left => self.input_field.del_word_left(), |