From: Daniel Carl <danielcarl@gmx.de>
Date: Tue, 3 Jun 2014 10:29:39 +0000 (+0200)
Subject: Fixed not working * and # commands.
X-Git-Url: https://git.owens.tech/editable-focus.html/editable-focus.html/git?a=commitdiff_plain;h=43439ab18d096603e076d64b00ae0b4f0c660e05;p=vimb.git

Fixed not working * and # commands.

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.
---

diff --git a/src/command.c b/src/command.c
index d4d3502..5c85794 100644
--- a/src/command.c
+++ b/src/command.c
@@ -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('/');
diff --git a/src/ex.c b/src/ex.c
index e75a2e8..26a56c4 100644
--- 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;