summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-01-14 21:31:34 +0100
committerBram Moolenaar <Bram@vim.org>2014-01-14 21:31:34 +0100
commitac8400d48354a62b7b761cf6897641876d2c476d (patch)
tree7ad6a652a42adbe9d37ba7451bae47a542c2de38
parent8822a9c3670cd91fe398424643cba2d353823862 (diff)
downloadvim-git-ac8400d48354a62b7b761cf6897641876d2c476d.tar.gz
updated for version 7.4.155v7.4.155
Problem: ":keeppatterns /pat" does not keep search pattern offset. Solution: Restore the offset after doing the search.
-rw-r--r--src/search.c2
-rw-r--r--src/testdir/test14.in5
-rw-r--r--src/testdir/test14.ok1
-rw-r--r--src/version.c2
4 files changed, 8 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c
index e4985761a..0341a5e47 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1437,7 +1437,7 @@ do_search(oap, dirc, pat, count, options, tm)
curwin->w_set_curswant = TRUE;
end_do_search:
- if (options & SEARCH_KEEP)
+ if ((options & SEARCH_KEEP) || cmdmod.keeppatterns)
spats[0].off = old_off;
vim_free(strcopy);
diff --git a/src/testdir/test14.in b/src/testdir/test14.in
index e6816a3f9..fb987ebc8 100644
--- a/src/testdir/test14.in
+++ b/src/testdir/test14.in
@@ -56,7 +56,10 @@ j:call search('^$', 'c')
:$put =@/
/^substitute
Y:$put =@0
-:/^search()/,$w >>test.out
+/bar /e
+:$put =@0
+-:keeppatterns /xyz
+0dn:/^search()/,$w >>test.out
:qa!
ENDTEST
diff --git a/src/testdir/test14.ok b/src/testdir/test14.ok
index ae3da2935..0aa2db3f9 100644
--- a/src/testdir/test14.ok
+++ b/src/testdir/test14.ok
@@ -23,3 +23,4 @@ two
foo
^substitute
substitute bar xyz
+xyz
diff --git a/src/version.c b/src/version.c
index 9b017bb7c..9d3ff576e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 155,
+/**/
154,
/**/
153,