VisualPosition () { if (mySelectionEndPosition == null) { // We cache the value to avoid repeated invocations of Editor.logicalPositionToOffset which is currently slow for long lines mySelectionEndPosition = getSelectionModel().getSelectionEndPosition(); } return mySelectionEndPosition; }