Autoscroll to the last cursor in model when inserting text

Fixes #2787