VIM-702 Fix infinite loop on s/$/\r/g

Fixes https://youtrack.jetbrains.com/issue/VIM-702.

If the replacement contains newlines, the line number of the current
search position needs to be adjusted. Without this, e.g. s/$/\r/g would
get into an infinite loop.