Fix Find button with search as you type

This commit is contained in:
Juergen Spitzmueller 2021-02-17 14:32:26 +01:00
parent 05004e138f
commit 180fca2fcd
2 changed files with 6 additions and 5 deletions

View File

@ -193,17 +193,17 @@ void GuiSearchWidget::findChanged()
replacePrevPB->setEnabled(replace);
replaceallPB->setEnabled(replace);
if (instantSearchCB->isChecked() && !emptytext)
findClicked();
findClicked(false, true);
}
void GuiSearchWidget::findClicked(bool const backwards)
void GuiSearchWidget::findClicked(bool const backwards, bool const instant)
{
docstring const needle = qstring_to_ucs4(findCO->currentText());
find(needle, caseCB->isChecked(), wordsCB->isChecked(), !backwards,
instantSearchCB->isChecked(), wrapCB->isChecked(), selectionCB->isChecked());
instant, wrapCB->isChecked(), selectionCB->isChecked());
uniqueInsert(findCO, findCO->currentText());
if (!instantSearchCB->isChecked())
if (!instant)
findCO->lineEdit()->selectAll();
}

View File

@ -45,7 +45,8 @@ public:
private Q_SLOTS:
void findChanged();
void findBufferChanged();
void findClicked(bool const backwards = false);
void findClicked(bool const backwards = false,
bool const instant = false);
void findPrevClicked();
void replaceClicked(bool const backwards = false);
void replacePrevClicked();