int () { ApplicationManager.getApplication().assertReadAccessAllowed(); if (hasSelection()) { RangeMarker marker = mySelectionMarker; if (marker != null) { return marker.getEndOffset(); } } return getOffset(); }