Fix hang for single result search after others
Add check for equal start and end indices in updateHighlights, stop
the search loop when this happens. Regular search still seems to
work fine (if you found this via 'git blame', whoops).
Unfortunately, this seems specific to the contents of a buffer.
First, find a buffer that you've encountered freezing, and keep track
of what was loaded, where it was, and the two most recent search
terms.
For example...
1. Load some backlog to a buffer
2. Search for term with any number of matches
3. Making sure to -type over existing words without first
backspacing-, search for another term with only one match
Expected: Search results found, no freezing
Actual: Quassel hangs. startPos and endPos = same place,
start = 0, end = 0, _currentHighlight appears to retain
values from the previous search.
Resolves GH-259.
(cherry picked from commit
6d35d3ab0b4885c2db40e5aa25574a5764e52c51)