From: Juergen Spitzmueller Date: Wed, 17 Feb 2021 13:32:26 +0000 (+0100) Subject: Fix Find button with search as you type X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=180fca2fcdcad4031959e76f738eeae13e5ba398;p=features.git Fix Find button with search as you type --- diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp index 01f3ec89f9..fcb8c85e53 100644 --- a/src/frontends/qt/GuiSearch.cpp +++ b/src/frontends/qt/GuiSearch.cpp @@ -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(); } diff --git a/src/frontends/qt/GuiSearch.h b/src/frontends/qt/GuiSearch.h index d3574b3363..6e05f49754 100644 --- a/src/frontends/qt/GuiSearch.h +++ b/src/frontends/qt/GuiSearch.h @@ -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();