Thanks Christian for the excellent gn added in 7.3.610. However,
using Vim 7.4.972 I'm seeing this problem with cgn after search.
Put the cursor at beginning of line:
abc x def x ghi x jkl
Type /x and press Enter to find first x.
Type cgn"x" and press Esc to replace search hit with "x" (three
characters).
Press n to find next x then press . to repeat change.
Expected result:
abc "x" def "x" ghi x jkl
Actual result:
abc "x" def "x" jkl
The problem occurs when the search is for a single character,
and the replacement text ("x" above) includes the search.
The problem can also be seen by simply trying cgn on the
second x.
John
Thanks! I applied the patch and did some tests trying to break
it, but it works well.
I don't understand the code, but I can see that:
flag + SEARCH_KEEP + SEARCH_END
works because of the possible values in flag, and '+' is how it
was done earlier in "SEARCH_KEEP + flag", but why not replace
each '+' with '|'?
John