Clear input after load commited during search.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 21 Apr 2017 09:05:05 +0000 (11:05 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 21 Apr 2017 09:05:05 +0000 (11:05 +0200)
If a new page is opened during search, the search string was still
present in the input box even if the searching is paused in this case.
So now clear the input box and stop searching in case of a new page
load.

src/command.c
src/main.c

index 4913ddc..fdea708 100644 (file)
@@ -45,6 +45,7 @@ gboolean command_search(Client *c, const Arg *arg)
         c->state.search.matches = 0;
         c->state.search.active  = FALSE;
         vb_statusbar_update(c);
+        vb_echo(c, MSG_NORMAL, FALSE, "");
         return TRUE;
     }
 
index 85b3c53..76b8779 100644 (file)
@@ -28,6 +28,7 @@
 #include <webkit2/webkit2.h>
 
 #include "ascii.h"
+#include "command.h"
 #include "completion.h"
 #include "config.h"
 #include "ex.h"
@@ -1143,6 +1144,9 @@ static void on_webview_load_changed(WebKitWebView *webview,
             /* clear possible set marks */
             marks_clear(c);
 
+            /* Unset possible last search. */
+            command_search(c, &((Arg){0}));
+
             break;
 
         case WEBKIT_LOAD_FINISHED: