]> git.lyx.org Git - features.git/commitdiff
Fix Find button with search as you type
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 17 Feb 2021 13:32:26 +0000 (14:32 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 17 Feb 2021 13:32:26 +0000 (14:32 +0100)
src/frontends/qt/GuiSearch.cpp
src/frontends/qt/GuiSearch.h

index 01f3ec89f954bb44ef756f389959b42b347f7731..fcb8c85e53e789766b96566f5c112db7147a2ac6 100644 (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();
 }
 
index d3574b3363226d42874ac5c8450e69b05f871ad0..6e05f49754d9cd2fdbd2b41160af47a5fd5b36d0 100644 (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();