Set caret in position

My solution to #4