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:
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -23,3 +23,4 @@ two
|
||||
foo
|
||||
^substitute
|
||||
substitute bar xyz
|
||||
xyz
|
||||
|
@@ -738,6 +738,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
155,
|
||||
/**/
|
||||
154,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user