summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2014-05-31 00:01:42 +0200
committerDaniel Carl <danielcarl@gmx.de>2014-05-31 00:06:59 +0200
commitd6c9be068182e52722e08da81e1733ad8623058c (patch)
tree2816137a47d57c8989ed46cd2ebf093e46898863
parent69c8d0251ac9b0246e7feeb58506fc6013cd7dbb (diff)
Used new register "/ to continue search.
-rw-r--r--src/command.c9
1 files changed, 6 insertions, 3 deletions
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;