aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2017-11-12 22:06:23 -0800
committeriximeow <me@iximeow.net>2017-11-12 22:46:42 -0800
commit63056a669de831ee7cd42517028657c4a23bf3e7 (patch)
tree2a174457f2f85697615491423f2a08de24f52ea6 /src
parentb89e3ca265050eb71d75ccb9a41230b38e4d54c6 (diff)
support ctrl+u similarly to readline
Diffstat (limited to 'src')
-rw-r--r--src/main.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 031ad37..6bed875 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -272,6 +272,18 @@ fn handle_input(event: termion::event::Event, tweeter: &mut tw::TwitterCache, qu
}
// would Shift('\n') but.. that doesn't exist.
// would Ctrl('\n') but.. that doesn't work.
+ Event::Key(Key::Ctrl('u')) => {
+ match tweeter.display_info.mode.clone() {
+ None => tweeter.display_info.input_buf = vec![],
+ Some(display::DisplayMode::Compose(msg)) => {
+ // TODO: clear only one line?
+ tweeter.display_info.mode = Some(display::DisplayMode::Compose("".to_owned()));
+ }
+ Some(display::DisplayMode::Reply(twid, msg)) => {
+ tweeter.display_info.mode = Some(display::DisplayMode::Reply(twid, "".to_owned()));
+ }
+ }
+ }
Event::Key(Key::Ctrl('n')) => {
match tweeter.display_info.mode.clone() {
Some(display::DisplayMode::Compose(msg)) => {