Fixed search starting in wrong direction.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 1 Jul 2013 18:50:01 +0000 (20:50 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 1 Jul 2013 18:50:01 +0000 (20:50 +0200)
If the search started, the current search direction wasn't set but the
resulting direction was calculated upon this value. This leads the search to
start search with the last match found on the page.

src/command.c

index 286ef3b..1387b47 100644 (file)
@@ -560,7 +560,7 @@ gboolean command_paste(const Arg *arg)
 
 gboolean command_search(const Arg *arg)
 {
-    gboolean forward = !(arg->i ^ vb.state.search_dir);
+    gboolean forward;
 
     if (arg->i == VB_SEARCH_OFF) {
 #ifdef FEATURE_SEARCH_HIGHLIGHT
@@ -575,6 +575,7 @@ gboolean command_search(const Arg *arg)
         /* set dearch dir only when the searching is started */
         vb.state.search_dir = arg->i;
     }
+    forward = !(arg->i ^ vb.state.search_dir);
 
     if (vb.state.search_query) {
 #ifdef FEATURE_SEARCH_HIGHLIGHT