From: Daniel Carl Date: Fri, 30 May 2014 22:01:42 +0000 (+0200) Subject: Used new register "/ to continue search. X-Git-Url: https://git.owens.tech/about.html/about.html/git?a=commitdiff_plain;h=d6c9be068182e52722e08da81e1733ad8623058c;p=vimb.git Used new register "/ to continue search. --- diff --git a/src/command.c b/src/command.c index 4de2279..d4d3502 100644 --- a/src/command.c +++ b/src/command.c @@ -32,7 +32,7 @@ extern VbCore vb; gboolean command_search(const Arg *arg) { static short dir; /* last direction 1 forward, -1 backward*/ - static char *query = NULL; + const char *query; static gboolean newsearch = true; gboolean forward; @@ -46,9 +46,12 @@ gboolean command_search(const Arg *arg) /* copy search query for later use */ if (arg->s) { - OVERWRITE_STRING(query, arg->s); /* set dearch dir only when the searching is started */ - dir = arg->i > 0 ? 1 : -1; + dir = arg->i > 0 ? 1 : -1; + query = arg->s; + } else { + /* no search phrase given - continue a previous search */ + query = vb_register_get('/'); } forward = (arg->i * dir) > 0;