fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit 9e108b3b288558adf1740677602a7d617fc33837 parent 632ba1ba33b8dda2569c689bf610d75dffefe3fb Author: John Hawthorn <john@hawthorn.email> Date: Sun, 9 Sep 2018 20:53:50 -0700 Reduce ambiguous char wait time to 25ms Diffstat:
| M | src/config.def.h | | | 3 | +++ |
| M | src/tty.c | | | 4 | +++- |
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/config.def.h b/src/config.def.h @@ -8,3 +8,6 @@ #define SCORE_MATCH_WORD 0.8 #define SCORE_MATCH_CAPITAL 0.7 #define SCORE_MATCH_DOT 0.6 + +/* Time (in ms) to wait for additional bytes of an escape sequence */ +#define KEYTIMEOUT 25 diff --git a/src/tty.c b/src/tty.c @@ -9,6 +9,8 @@ #include "tty.h" +#include "../config.h" + void tty_reset(tty_t *tty) { tcsetattr(tty->fdin, TCSANOW, &tty->original_termios); } @@ -89,7 +91,7 @@ char tty_getchar(tty_t *tty) { int tty_input_ready(tty_t *tty, int pending) { fd_set readfs; - struct timeval tv = {0, pending ? 500000 : 0}; + struct timeval tv = {0, pending ? (KEYTIMEOUT * 1000) : 0}; FD_ZERO(&readfs); FD_SET(tty->fdin, &readfs); select(tty->fdin + 1, &readfs, NULL, NULL, &tv);