fix initial caret positioning