Fix jumping cursor

By setting caret position after substitution
Fix attribution for caret plugin