From: Daniel Carl Date: Sat, 27 Jul 2013 10:24:17 +0000 (+0200) Subject: Don't pollute the global count for search query. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=0f246791f338a8cea98f8dbd9c179e7594535467;p=vimb.git Don't pollute the global count for search query. No there is a own count variable used for search, so that we don't print the default 1 to the statubar, if the user hasn't requested this. By the way also requested counts are reset if there was no item found. --- diff --git a/src/command.c b/src/command.c index 89c45bc..418bf1d 100644 --- a/src/command.c +++ b/src/command.c @@ -593,6 +593,7 @@ gboolean command_search(const Arg *arg) forward = !(arg->i ^ dir); if (query) { + int count; #ifdef FEATURE_SEARCH_HIGHLIGHT if (!highlight) { /* highlight matches if the search is started new or continued @@ -607,14 +608,16 @@ gboolean command_search(const Arg *arg) #endif /* make sure we have a count greater than 0 */ - vb.state.count = vb.state.count ? vb.state.count : 1; + count = vb.state.count ? vb.state.count : 1; do { if (!webkit_web_view_search_text(vb.gui.webview, query, false, forward, true)) { break; } - } while (--vb.state.count); + } while (--count); } + /* unset posibble set count */ + vb.state.count = 0; vb_set_mode(VB_MODE_NORMAL | VB_MODE_SEARCH, false); return true;