2141 Private method to search for the next occurrence. |
2141 Private method to search for the next occurrence. |
2142 """ |
2142 """ |
2143 if self.__lastSearch: |
2143 if self.__lastSearch: |
2144 self.searchNext(*self.__lastSearch) |
2144 self.searchNext(*self.__lastSearch) |
2145 |
2145 |
2146 def searchNext(self, txt, caseSensitive, wholeWord): |
2146 def searchNext(self, txt, caseSensitive, wholeWord, regexp): |
2147 """ |
2147 """ |
2148 Public method to search the next occurrence of the given text. |
2148 Public method to search the next occurrence of the given text. |
2149 |
2149 |
2150 @param txt text to search for (string) |
2150 @param txt text to search for |
|
2151 @type str |
2151 @param caseSensitive flag indicating to perform a case sensitive |
2152 @param caseSensitive flag indicating to perform a case sensitive |
2152 search (boolean) |
2153 search |
|
2154 @type bool |
2153 @param wholeWord flag indicating to search for whole words |
2155 @param wholeWord flag indicating to search for whole words |
2154 only (boolean) |
2156 only |
2155 """ |
2157 @type bool |
2156 self.__lastSearch = (txt, caseSensitive, wholeWord) |
2158 @param regexp flag indicating a regular expression search |
|
2159 @type bool |
|
2160 """ |
|
2161 self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) |
2157 ok = self.findFirst( |
2162 ok = self.findFirst( |
2158 txt, False, caseSensitive, wholeWord, True, forward=True) |
2163 txt, regexp, caseSensitive, wholeWord, True, forward=True, |
|
2164 posix=regexp) |
2159 self.searchStringFound.emit(ok) |
2165 self.searchStringFound.emit(ok) |
2160 |
2166 |
2161 def __searchPrev(self): |
2167 def __searchPrev(self): |
2162 """ |
2168 """ |
2163 Private method to search for the next occurrence. |
2169 Private method to search for the next occurrence. |
2164 """ |
2170 """ |
2165 if self.__lastSearch: |
2171 if self.__lastSearch: |
2166 self.searchPrev(*self.__lastSearch) |
2172 self.searchPrev(*self.__lastSearch) |
2167 |
2173 |
2168 def searchPrev(self, txt, caseSensitive, wholeWord): |
2174 def searchPrev(self, txt, caseSensitive, wholeWord, regexp): |
2169 """ |
2175 """ |
2170 Public method to search the previous occurrence of the given text. |
2176 Public method to search the previous occurrence of the given text. |
2171 |
2177 |
2172 @param txt text to search for (string) |
2178 @param txt text to search for |
|
2179 @type str |
2173 @param caseSensitive flag indicating to perform a case sensitive |
2180 @param caseSensitive flag indicating to perform a case sensitive |
2174 search (boolean) |
2181 search |
|
2182 @type bool |
2175 @param wholeWord flag indicating to search for whole words |
2183 @param wholeWord flag indicating to search for whole words |
2176 only (boolean) |
2184 only |
2177 """ |
2185 @type bool |
2178 self.__lastSearch = (txt, caseSensitive, wholeWord) |
2186 @param regexp flag indicating a regular expression search |
|
2187 @type bool |
|
2188 """ |
|
2189 self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) |
2179 if self.hasSelectedText(): |
2190 if self.hasSelectedText(): |
2180 line, index = self.getSelection()[:2] |
2191 line, index = self.getSelection()[:2] |
2181 else: |
2192 else: |
2182 line, index = -1, -1 |
2193 line, index = -1, -1 |
2183 ok = self.findFirst( |
2194 ok = self.findFirst( |
2184 txt, False, caseSensitive, wholeWord, True, |
2195 txt, regexp, caseSensitive, wholeWord, True, |
2185 forward=False, line=line, index=index) |
2196 forward=False, line=line, index=index, posix=regexp) |
2186 self.searchStringFound.emit(ok) |
2197 self.searchStringFound.emit(ok) |
2187 |
2198 |
2188 def historyStyle(self): |
2199 def historyStyle(self): |
2189 """ |
2200 """ |
2190 Public method to get the shell history style. |
2201 Public method to get the shell history style. |