Skip to content

KateRegExpSearch: fix logic when adding '\n' between range lines

Ahmad Samir requested to merge work/ahmad/search-wrapping into master

The rationale is that we add an '\n' as a delimiter between lines in the range; but never after the last line as that would add an '\n' that isn't there in the original text, and may skew search results. The code was using rangeEndLine to check if it's at the last line, but the last line in the range is (rangeLineCount - 1).

Also this prevents an assert in QVector::at() when accessing the lineLens container later in the code.

Added unit test.

Merge request reports