Corrected an issue searching and replacing all in the current selection only hidden by having the Quicksearch function enabled. eric7

Mon, 08 Jul 2024 17:13:09 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 08 Jul 2024 17:13:09 +0200
branch
eric7
changeset 10833
4c8c1e51ffa6
parent 10832
479cf39ac9cb
child 10834
6f5cb518cf13

Corrected an issue searching and replacing all in the current selection only hidden by having the Quicksearch function enabled.

src/eric7/QScintilla/SearchReplaceWidget.py file | annotate | diff | comparison | revisions
--- a/src/eric7/QScintilla/SearchReplaceWidget.py	Sun Jul 07 12:57:21 2024 +0200
+++ b/src/eric7/QScintilla/SearchReplaceWidget.py	Mon Jul 08 17:13:09 2024 +0200
@@ -558,9 +558,9 @@
                 self.caseCheckBox.isChecked(),
                 self.wordCheckBox.isChecked(),
                 self.wrapCheckBox.isChecked(),
-                not self.__findBackwards,
-                lineFrom,
-                indexFrom,
+                forward=not self.__findBackwards,
+                line=lineFrom,
+                index=indexFrom,
                 posix=posixMode,
                 cxx11=cxx11Mode,
             )
@@ -921,9 +921,9 @@
                 self.caseCheckBox.isChecked(),
                 self.wordCheckBox.isChecked(),
                 self.wrapCheckBox.isChecked(),
-                not backwards,
-                line,
-                index,
+                forward=not backwards,
+                line=line,
+                index=index,
                 posix=posixMode,
                 cxx11=cxx11Mode,
             )
@@ -975,9 +975,9 @@
                         self.caseCheckBox.isChecked(),
                         self.wordCheckBox.isChecked(),
                         self.wrapCheckBox.isChecked(),
-                        not backwards,
-                        line,
-                        index,
+                        forward=not backwards,
+                        line=line,
+                        index=index,
                         posix=posixMode,
                         cxx11=cxx11Mode,
                     )
@@ -1006,9 +1006,9 @@
                         self.caseCheckBox.isChecked(),
                         self.wordCheckBox.isChecked(),
                         self.wrapCheckBox.isChecked(),
-                        not backwards,
-                        line,
-                        index,
+                        forward=not backwards,
+                        line=line,
+                        index=index,
                         posix=posixMode,
                         cxx11=cxx11Mode,
                     )
@@ -1261,6 +1261,7 @@
         if selectionOnly:
             boundary = self.__selectionBoundary()
             aw.highlightSearchSelection(*boundary)
+            aw.setSelection(*boundary)  # Just in case it was changed by quicksearch.
         else:
             line = 0
             index = 0
@@ -1281,8 +1282,7 @@
                 self.regexpCheckBox.isChecked(),
                 self.caseCheckBox.isChecked(),
                 self.wordCheckBox.isChecked(),
-                False,
-                True,
+                forward=True,
                 posix=posixMode,
                 cxx11=cxx11Mode,
             )
@@ -1293,9 +1293,9 @@
                 self.caseCheckBox.isChecked(),
                 self.wordCheckBox.isChecked(),
                 False,
-                True,
-                line,
-                index,
+                forward=True,
+                line=line,
+                index=index,
                 posix=posixMode,
                 cxx11=cxx11Mode,
             )
@@ -1311,12 +1311,7 @@
         while ok:
             aw.replace(rtxt)
             replacements += 1
-            ok = (
-                self.__findNextPrev(ftxt, self.__findBackwards)
-                if selectionOnly
-                else aw.findNext()
-            )
-            self.__finding = True
+            ok = aw.findNext()
         aw.endUndoAction()
         if wordWrap:
             self.wrapCheckBox.setChecked(True)
@@ -1341,6 +1336,9 @@
 
         self.__finding = False
 
+        aw.clearSearchSelectionHighlight()
+        self.updateSelectionCheckBox(aw)
+
     def __showReplace(self, text=""):
         """
         Private slot to display this widget in replace mode.

eric ide

mercurial