changeset 5606:15960ebc2ee8 v7.4.150

updated for version 7.4.150 Problem: :keeppatterns is not respected for :s. Solution: Check the keeppatterns flag. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Tue, 14 Jan 2014 15:53:51 +0100
parents 339a410f525a
children 98a642716acc
files src/search.c src/testdir/test14.in src/testdir/test14.ok src/version.c
diffstat 4 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -201,7 +201,7 @@ search_regcomp(pat, pat_save, pat_use, o
      * Save the currently used pattern in the appropriate place,
      * unless the pattern should not be remembered.
      */
-    if (!(options & SEARCH_KEEP))
+    if (!(options & SEARCH_KEEP) && !cmdmod.keeppatterns)
     {
 	/* search or global command */
 	if (pat_save == RE_SEARCH || pat_save == RE_BOTH)
--- a/src/testdir/test14.in
+++ b/src/testdir/test14.in
@@ -47,6 +47,15 @@ j:call search('^$', 'c')
 /two
 :call search('.', 'c')
 :call append(line('$'), getline('.')[col('.') - 1:])
+:"
+/^substitute
+:s/foo/bar/
+:$put =@/
+/^substitute
+:keeppatterns s/asdf/xyz/
+:$put =@/
+/^substitute
+Y:$put =@0
 :/^search()/,$w >>test.out
 :qa!
 ENDTEST
@@ -81,6 +90,7 @@ Piece of Java
 
 foobar
 
+substitute foo asdf
 
 one two
 search()
--- a/src/testdir/test14.ok
+++ b/src/testdir/test14.ok
@@ -20,3 +20,6 @@ 0
 1
 1
 two
+foo
+^substitute
+substitute bar xyz
--- 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 */
 /**/
+    150,
+/**/
     149,
 /**/
     148,