really, really fix restoring caret position