Fixed not working * and # commands.
authorDaniel Carl <danielcarl@gmx.de>
Tue, 3 Jun 2014 10:29:39 +0000 (12:29 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Tue, 3 Jun 2014 10:29:39 +0000 (12:29 +0200)
If a search phrase was marked and * or # was used, the right matches where
highlighted but 'n' or 'N' did not jump to the next match.

src/command.c
src/ex.c

index d4d3502..5c85794 100644 (file)
@@ -49,6 +49,8 @@ gboolean command_search(const Arg *arg)
         /* set dearch dir only when the searching is started */
         dir   = arg->i > 0 ? 1 : -1;
         query = arg->s;
+        /* add new search query to history and search register */
+        vb_register_add('/', query);
     } else {
         /* no search phrase given - continue a previous search */
         query = vb_register_get('/');
index e75a2e8..26a56c4 100644 (file)
--- a/src/ex.c
+++ b/src/ex.c
@@ -442,7 +442,6 @@ static void input_activate(void)
         case '?':
             mode_enter('n');
             command_search(&((Arg){count, cmd}));
-            vb_register_add('/', cmd);
             history_add(HISTORY_SEARCH, cmd, NULL);
             break;
 
@@ -454,6 +453,8 @@ static void input_activate(void)
         case ':':
             mode_enter('n');
             ex_run_string(cmd);
+            /* TODO fill register and history in ex_run_string but not if this
+             * is called on reading the config file */
             vb_register_add(':', cmd);
             history_add(HISTORY_COMMAND, cmd, NULL);
             break;