summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2014-08-16 20:08:51 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-08-16 20:10:49 -0700
commit86170ce65a9239abf33c1ca094aefdab065df53b (patch)
tree2a0d9a48f158c5d805d1c7d9a2f5c3ec26cc0088
parent0773e6fb700e6ced3bbb3b026ca582ade4088490 (diff)
Support UP/DOWN arrow
-rw-r--r--fzy.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fzy.c b/fzy.c
index f99d735..10a5a7d 100644
--- a/fzy.c
+++ b/fzy.c
@@ -198,6 +198,16 @@ void run(tty_t *tty){
}else if(ch == 10){ /* Enter */
clear(tty);
emit(tty);
+ }else if(ch == 27){ /* ESC */
+ ch = tty_getchar(tty);
+ if(ch == '['){
+ ch = tty_getchar(tty);
+ if(ch == 'A'){ /* UP ARROW */
+ action_prev();
+ }else if(ch == 'B'){ /* DOWN ARROW */
+ action_next();
+ }
+ }
}
}while(1);
}