[QScintilla] Resetting search for replace

Manuel Gómez mgrojo at gmail.com
Fri Nov 16 20:31:12 GMT 2018


Hi,

How should a search be canceled so a subsequent call to replace does 
nothing?

The following sequence would insert the searched text instead of 
actually replacing or doing nothing:

// user presses my find button
findFirst(...);

// user closes the find dialog
clearSelection();

// user opens again the find/replace dialog and clicks Replace
replace();

If I do this, the behaviour improves:

// user opens again the find/replace dialog and clicks replace
if (hasSelectedText())
     replace();

But if the user makes any selection before opening the dialog, the 
incorrect text is replaced, not fulfilling the searched term. Any better 
solution?

Regards,

Manuel


More information about the QScintilla mailing list