loh.tar added a comment.
Ah, `r.toEditorRange().isValid()` is the trick, yes, would work. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D19407 To: loh.tar, #ktexteditor Cc: dhaumann, kwrite-devel, kde-frameworks-devel, #ktexteditor, domson, michaelh, ngraham, bruns, demsking, cullmann, sars