Stop previous search before new one (#66).
authorDaniel Carl <danielcarl@gmx.de>
Mon, 24 Feb 2014 08:10:12 +0000 (09:10 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 24 Feb 2014 08:10:12 +0000 (09:10 +0100)
If there is an active search with highlighted matches and the user uses `#` or
`*` to start a new search for marked text, the old hightlights where kept but
the search uses the marked text. Now a possible previous search is stopped
before the new one is started.

src/normal.c

index acb03a6..e69f13e 100644 (file)
@@ -724,6 +724,9 @@ static VbResult normal_search_selection(const NormalCmdInfo *info)
     }
     count = (info->count > 0) ? info->count : 1;
 
+    /* stopp possible existing search and the search highlights before
+     * starting the new search query */
+    command_search(&((Arg){0}));
     command_search(&((Arg){info->key == '*' ? count : -count, query}));
     g_free(query);