From: Robert Timm Date: Mon, 17 Apr 2017 20:41:15 +0000 (+0200) Subject: moves incsearch to ex_input_changed (closes #370) X-Git-Url: https://git.owens.tech/rss.xml/rss.xml/git?a=commitdiff_plain;h=e6f4bc018e6378e3d3c4572fa8c4bedf4f69f708;p=vimb.git moves incsearch to ex_input_changed (closes #370) --- diff --git a/src/ex.c b/src/ex.c index 79191b2..20e0eaa 100644 --- a/src/ex.c +++ b/src/ex.c @@ -348,15 +348,6 @@ VbResult ex_keypress(Client *c, int key) } } - if (c->config.incsearch && key != KEY_CR) { - gtk_text_buffer_get_bounds(buffer, &start, &end); - text = gtk_text_buffer_get_text(buffer, &start, &end, false); - if (text && (*text == '/' || *text == '?')) { - command_search(c, &((Arg){0, NULL})); /* stop last search */ - command_search(c, &((Arg){*text == '/' ? 1 : -1, (char*)text + 1})); - } - } - /* if the user deleted some content of the inputbox we check if the * inputbox is empty - if so we switch back to normal like vim does */ if (check_empty) { @@ -398,6 +389,13 @@ void ex_input_changed(Client *c, const char *text) case 'g': /* TODO create hints */ break; + case '/': /* fall through */ + case '?': + if (c->config.incsearch) { + command_search(c, &((Arg){0, NULL})); /* stop last search */ + command_search(c, &((Arg){*text == '/' ? 1 : -1, (char*)text + 1})); + } + break; } }