fzy

terminal fuzzy finder picker

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

commit cbb92609b3a9a54ba6b3548f709b2a8235dedcd9
parent ec7e3652b5c6241e5bb6dc8dc70cbeb3e8403320
Author: John Hawthorn <john@hawthorn.email>
Date:   Sat, 15 Sep 2018 20:59:46 -0700

Remove unnecessary check from action_del_char

Diffstat:
Msrc/tty_interface.c | 18++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/tty_interface.c b/src/tty_interface.c @@ -142,19 +142,17 @@ static void action_emit(tty_interface_t *state) { } static void action_del_char(tty_interface_t *state) { - if (*state->search) { - size_t length = strlen(state->search); - if (state->cursor == 0) { - return; - } - size_t original_cursor = state->cursor; + size_t length = strlen(state->search); + if (state->cursor == 0) { + return; + } + size_t original_cursor = state->cursor; + state->cursor--; + while (!is_boundary(state->search[state->cursor]) && state->cursor) state->cursor--; - while (!is_boundary(state->search[state->cursor]) && state->cursor) - state->cursor--; - memmove(&state->search[state->cursor], &state->search[original_cursor], length - original_cursor + 1); - } + memmove(&state->search[state->cursor], &state->search[original_cursor], length - original_cursor + 1); } static void action_del_word(tty_interface_t *state) {