When editing at the bottom of the text area, after the preview and
the resulting resizing, we can observe an awkward "page up" effect
which moves the position of the cursor out of sight.
We remember the window scroll position before the preview and
resets it afterwards, which cancels this unwanted move.