[QScintilla] Resetting search for replace

Manuel Gómez mgrojo at gmail.com
Sat Nov 17 12:34:27 GMT 2018


El 17/11/18 a las 12:31, Phil Thompson escribió:
> On 16 Nov 2018, at 8:31 pm, Manuel Gómez <mgrojo at gmail.com> wrote:
>> How should a search be canceled so a subsequent call to replace does nothing?
> 
> Call findFirst() with an empty search string.

Thank you, that worked.


>>
>> But if the user makes any selection before opening the dialog, the incorrect text is replaced, not fulfilling the searched term. Any better solution?
> 
> I could add a cancelFind() which does the same as findFirst('').

That would be more clear. Another option is, at least, mentioning it in 
the findFirst documentation.

I think that not knowing how to reset a search is the reason why I'm not 
using findNext in my code (only repetitive calls to findFirst). Without 
a way to reset the search, findNext seems more difficult to use than 
only calls to findFirst skipping the selection if the user searches 
backwards.

Regards,

Manuel


More information about the QScintilla mailing list