[QScintilla] findFirst with forward=false doesn't keep finding

Phil Thompson phil at riverbankcomputing.com
Fri Jun 24 13:47:41 BST 2011


On Thu, 23 Jun 2011 23:05:17 -0500, Christopher Pow
<christopher_pow at hotmail.com> wrote:
> I have some code that calls findFirst over and over again.  As long as I
> set forward to true it finds the next, next, next, ... on subsequent
calls
> like you would expect [I don't use findNext].  If I set forward to false
it
> remains where it is, it refuses to find previous unless I un-highlight
the
> found text.  Even then it will only find previous once, it won't keep
> going.  Am I using findFirst wrong?  It seems it's finding the same text
> which probably means the cursor is positioned at the end of the
previously
> found/selected text.  I verified this by using getCursorPosition and
> adjusting the returned index by -1 and passing that index to
findFirst(). 
> That makes both forward/backward searches work but seems a bit hokey.

Use findNext() for subsequent searches of the same text - that's what it's
there for.

Phil


More information about the QScintilla mailing list