fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit 163af36e93a41a83f37623eed25710c97f5ee5db
parent e532fdabdc53615258f434f006a1cb3c3e2ce92e
Author: John Hawthorn <john.hawthorn@gmail.com>
Date:   Mon,  2 May 2016 21:48:09 -0700

Make run returns on success, then exit from main

No real advantage, but I get to feel warm and fuzzy about

    HEAP SUMMARY:
        in use at exit: 0 bytes in 0 blocks
      total heap usage: 8 allocs, 8 frees, 15,425 bytes allocated

Diffstat:
Mfzy.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fzy.c b/fzy.c @@ -99,8 +99,6 @@ static void emit(choices_t *choices) { /* No match, output the query instead */ printf("%s\n", search); } - - exit(EXIT_SUCCESS); } #define KEY_CTRL(key) ((key) - ('@')) @@ -152,6 +150,9 @@ static void run(tty_t *tty, choices_t *choices) { tty_close(tty); emit(choices); + + /* Return to eventually exit successfully */ + return; } else if (ch == KEY_ESC) { /* ESC */ ch = tty_getchar(tty); if (ch == '[' || ch == 'O') {