Caret position is now preserved after format

- Fixes #7