diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-10-20 11:22:47 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-10-20 11:35:43 +0300 |
commit | 565b11634a3daa0a28808a13cd8df2c9439f9b96 (patch) | |
tree | 94913386d57a1f65d0975105979fc629690e00c3 /ui/src/components/utilities/widgets.rs | |
parent | 1a02491f0459d1c58f9771535eeed6b0ae4e6772 (diff) |
ui: add two readline shortcuts in text fields
Diffstat (limited to 'ui/src/components/utilities/widgets.rs')
-rw-r--r-- | ui/src/components/utilities/widgets.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/src/components/utilities/widgets.rs b/ui/src/components/utilities/widgets.rs index 3acdb904..6d8c41db 100644 --- a/ui/src/components/utilities/widgets.rs +++ b/ui/src/components/utilities/widgets.rs @@ -187,6 +187,17 @@ impl Component for Field { } } } + UIEvent::InsertInput(Key::Ctrl('a')) => { + if let Text(ref mut s, _) = self { + s.set_cursor(0); + } + } + UIEvent::InsertInput(Key::Ctrl('e')) => { + if let Text(ref mut s, _) = self { + s.set_cursor(s.as_str().len()); + } + } + /* TODO: add rest of readline shortcuts */ _ => { return false; } |