Fix hang for single result search after others
authorShane Synan <digitalcircuit36939@gmail.com>
Thu, 13 Oct 2016 08:39:14 +0000 (03:39 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 13 Oct 2016 20:24:29 +0000 (22:24 +0200)
commit6d35d3ab0b4885c2db40e5aa25574a5764e52c51
treeec370ddd5ff2c475269c3bde4c761b10b2d55c3b
parentf323363cfe7d1545928e60f609d5a2926907f579
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.
src/qtui/chatviewsearchcontroller.cpp