cullmann added a comment.
My proposal would be: 1. not compute the batch ranges beforehand but just remember the complete range and compute the range for the next scan. 2. after scan is done without a hit, not start behind the range but start in the middle of the current range with again such a batch. That way we should avoid to skip even multi-line matches if you don't do perversions that match "xxxx" lines, which I think is ok for incremental search. The drawback is that one searches more text. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D19367 To: loh.tar, #ktexteditor Cc: cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, domson, michaelh, ngraham, bruns, demsking, sars, dhaumann