[LyX/master] Fix Find button with search as you type

Juergen Spitzmueller spitz at lyx.org
Wed Feb 17 13:29:13 UTC 2021


commit 180fca2fcdcad4031959e76f738eeae13e5ba398
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Wed Feb 17 14:32:26 2021 +0100

    Fix Find button with search as you type
---
 src/frontends/qt/GuiSearch.cpp |    8 ++++----
 src/frontends/qt/GuiSearch.h   |    3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp
index 01f3ec8..fcb8c85 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 d3574b3..6e05f49 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();


More information about the lyx-cvs mailing list