1
0
forked from aniani/vim

updated for version 7.4.155

Problem:    ":keeppatterns /pat" does not keep search pattern offset.
Solution:   Restore the offset after doing the search.
This commit is contained in:
Bram Moolenaar
2014-01-14 21:31:34 +01:00
parent 8822a9c367
commit ac8400d483
4 changed files with 8 additions and 2 deletions

View File

@@ -1437,7 +1437,7 @@ do_search(oap, dirc, pat, count, options, tm)
curwin->w_set_curswant = TRUE; curwin->w_set_curswant = TRUE;
end_do_search: end_do_search:
if (options & SEARCH_KEEP) if ((options & SEARCH_KEEP) || cmdmod.keeppatterns)
spats[0].off = old_off; spats[0].off = old_off;
vim_free(strcopy); vim_free(strcopy);

View File

@@ -56,7 +56,10 @@ j:call search('^$', 'c')
:$put =@/ :$put =@/
/^substitute /^substitute
Y:$put =@0 Y:$put =@0
:/^search()/,$w >>test.out /bar /e
:$put =@0
-:keeppatterns /xyz
0dn:/^search()/,$w >>test.out
:qa! :qa!
ENDTEST ENDTEST

View File

@@ -23,3 +23,4 @@ two
foo foo
^substitute ^substitute
substitute bar xyz substitute bar xyz
xyz

View File

@@ -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 */
/**/
155,
/**/ /**/
154, 154,
/**/ /**/