Problem: ":keeppatterns /pat" does not keep search pattern offset.
Solution: Restore the offset after doing the search.
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);
:$put =@/
/^substitute
Y:$put =@0
-:/^search()/,$w >>test.out
+/bar /e
+:$put =@0
+-:keeppatterns /xyz
+0dn:/^search()/,$w >>test.out
:qa!
ENDTEST
foo
^substitute
substitute bar xyz
+xyz
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 155,
/**/
154,
/**/