QScintilla/Shell.py

changeset 6573
ccac2d1f6858
parent 6478
f76f5bd81a90
child 6576
ea60ea85067a
--- a/QScintilla/Shell.py	Thu Nov 01 15:43:03 2018 +0100
+++ b/QScintilla/Shell.py	Thu Nov 01 18:46:44 2018 +0100
@@ -2143,19 +2143,25 @@
         if self.__lastSearch:
             self.searchNext(*self.__lastSearch)
     
-    def searchNext(self, txt, caseSensitive, wholeWord):
+    def searchNext(self, txt, caseSensitive, wholeWord, regexp):
         """
         Public method to search the next occurrence of the given text.
         
-        @param txt text to search for (string)
+        @param txt text to search for
+        @type str
         @param caseSensitive flag indicating to perform a case sensitive
-            search (boolean)
+            search
+        @type bool
         @param wholeWord flag indicating to search for whole words
-            only (boolean)
+            only
+        @type bool
+        @param regexp flag indicating a regular expression search
+        @type bool
         """
-        self.__lastSearch = (txt, caseSensitive, wholeWord)
+        self.__lastSearch = (txt, caseSensitive, wholeWord, regexp)
         ok = self.findFirst(
-            txt, False, caseSensitive, wholeWord, True, forward=True)
+            txt, regexp, caseSensitive, wholeWord, True, forward=True,
+            posix=regexp)
         self.searchStringFound.emit(ok)
     
     def __searchPrev(self):
@@ -2165,24 +2171,29 @@
         if self.__lastSearch:
             self.searchPrev(*self.__lastSearch)
     
-    def searchPrev(self, txt, caseSensitive, wholeWord):
+    def searchPrev(self, txt, caseSensitive, wholeWord, regexp):
         """
         Public method to search the previous occurrence of the given text.
         
-        @param txt text to search for (string)
+        @param txt text to search for
+        @type str
         @param caseSensitive flag indicating to perform a case sensitive
-            search (boolean)
+            search
+        @type bool
         @param wholeWord flag indicating to search for whole words
-            only (boolean)
+            only
+        @type bool
+        @param regexp flag indicating a regular expression search
+        @type bool
         """
-        self.__lastSearch = (txt, caseSensitive, wholeWord)
+        self.__lastSearch = (txt, caseSensitive, wholeWord, regexp)
         if self.hasSelectedText():
             line, index = self.getSelection()[:2]
         else:
             line, index = -1, -1
         ok = self.findFirst(
-            txt, False, caseSensitive, wholeWord, True,
-            forward=False, line=line, index=index)
+            txt, regexp, caseSensitive, wholeWord, True,
+            forward=False, line=line, index=index, posix=regexp)
         self.searchStringFound.emit(ok)
     
     def historyStyle(self):

eric ide

mercurial