}
}
+ 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) {
case '/': count = 1; /* fall through */
case '?':
vb_enter(c, 'n');
- command_search(c, &((Arg){count, cmd}));
+
+ /* start search, if incsearch, it's done while typing */
+ if (!c->config.incsearch) {
+ command_search(c, &((Arg){count, cmd}));
+ }
break;
case ';': /* fall through */
i = 100;
setting_add(c, "default-zoom", TYPE_INTEGER, &i, default_zoom, 0, NULL);
setting_add(c, "download-path", TYPE_CHAR, &"~", NULL, 0, NULL);
+ setting_add(c, "incsearch", TYPE_BOOLEAN, &off, internal, 0, &c->config.incsearch);
#ifdef FEATURE_GUI_STYLE_VIMB2_COMPAT
/* gui style settings vimb2 compatibility */