JetBrains/ideavim — pull request #57 by dezgeg (2014-12-03 12:08:05+00:00)
Title: 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.