Implement caret and position editing