Autoscroll *after* inserting text, not before

Fixes #2787