Fixed none printed :open .. on O.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 21 Apr 2017 09:45:32 +0000 (11:45 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 21 Apr 2017 09:45:32 +0000 (11:45 +0200)
If the input was filled programmatically and the mode where switched the
already filled input was cleaned by the attempt to stop possible search.
So now the input is only cleared if there is really an active search.

src/command.c

index fdea708..1ffb109 100644 (file)
@@ -41,11 +41,15 @@ gboolean command_search(Client *c, const Arg *arg)
 
     fc = webkit_web_view_get_find_controller(c->webview);
     if (arg->i == 0) {
+        /* Clear the input only if the search is active. */
+        if (c->state.search.active) {
+            vb_echo(c, MSG_NORMAL, FALSE, "");
+        }
         webkit_find_controller_search_finish(fc);
         c->state.search.matches = 0;
         c->state.search.active  = FALSE;
         vb_statusbar_update(c);
-        vb_echo(c, MSG_NORMAL, FALSE, "");
+
         return TRUE;
     }