Added textEditorClone to calculate cursor position.