Keep apparent scroll position fixed when changes are made offscreen

As discussed with @nightwing in #2041, this keeps the cursor and on-screen lines unchanged when changes are made to the document off screen. This is only an issue when using line wrapping, since a soft-wrap will cause all the content below to be pushed down by a row. This might happen in a collaborative editing context for example.