mirror of
https://github.com/vim/vim.git
synced 2025-10-15 07:14:09 -04:00
updated for version 7.4.150
Problem: :keeppatterns is not respected for :s. Solution: Check the keeppatterns flag. (Yasuhiro Matsumoto)
This commit is contained in:
@@ -201,7 +201,7 @@ search_regcomp(pat, pat_save, pat_use, options, regmatch)
|
|||||||
* Save the currently used pattern in the appropriate place,
|
* Save the currently used pattern in the appropriate place,
|
||||||
* unless the pattern should not be remembered.
|
* unless the pattern should not be remembered.
|
||||||
*/
|
*/
|
||||||
if (!(options & SEARCH_KEEP))
|
if (!(options & SEARCH_KEEP) && !cmdmod.keeppatterns)
|
||||||
{
|
{
|
||||||
/* search or global command */
|
/* search or global command */
|
||||||
if (pat_save == RE_SEARCH || pat_save == RE_BOTH)
|
if (pat_save == RE_SEARCH || pat_save == RE_BOTH)
|
||||||
|
@@ -47,6 +47,15 @@ j:call search('^$', 'c')
|
|||||||
/two
|
/two
|
||||||
:call search('.', 'c')
|
:call search('.', 'c')
|
||||||
:call append(line('$'), getline('.')[col('.') - 1:])
|
: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
|
:/^search()/,$w >>test.out
|
||||||
:qa!
|
:qa!
|
||||||
ENDTEST
|
ENDTEST
|
||||||
@@ -81,6 +90,7 @@ Piece of Java
|
|||||||
|
|
||||||
foobar
|
foobar
|
||||||
|
|
||||||
|
substitute foo asdf
|
||||||
|
|
||||||
one two
|
one two
|
||||||
search()
|
search()
|
||||||
|
@@ -20,3 +20,6 @@ search()
|
|||||||
1
|
1
|
||||||
1
|
1
|
||||||
two
|
two
|
||||||
|
foo
|
||||||
|
^substitute
|
||||||
|
substitute bar xyz
|
||||||
|
@@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
150,
|
||||||
/**/
|
/**/
|
||||||
149,
|
149,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user