435 if fdesc is not None: |
435 if fdesc is not None: |
436 font = QFont(fdesc[0], int(fdesc[1])) |
436 font = QFont(fdesc[0], int(fdesc[1])) |
437 self.lexer_.setDefaultFont(font) |
437 self.lexer_.setDefaultFont(font) |
438 self.setLexer(self.lexer_) |
438 self.setLexer(self.lexer_) |
439 self.lexer_.readSettings(Preferences.Prefs.settings, "Scintilla") |
439 self.lexer_.readSettings(Preferences.Prefs.settings, "Scintilla") |
|
440 if self.lexer_.hasSubstyles(): |
|
441 self.lexer_.readSubstyles(self) |
440 |
442 |
441 # initialize the lexer APIs settings |
443 # initialize the lexer APIs settings |
442 api = self.vm.getAPIsManager().getAPIs(self.language) |
444 api = self.vm.getAPIsManager().getAPIs(self.language) |
443 if api is not None: |
445 if api is not None: |
444 api = api.getQsciAPIs() |
446 api = api.getQsciAPIs() |
2237 @type bool |
2239 @type bool |
2238 @param regexp flag indicating a regular expression search |
2240 @param regexp flag indicating a regular expression search |
2239 @type bool |
2241 @type bool |
2240 """ |
2242 """ |
2241 self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) |
2243 self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) |
|
2244 posixMode = Preferences.getEditor("SearchRegexpMode") == 0 and regexp |
|
2245 cxx11Mode = Preferences.getEditor("SearchRegexpMode") == 1 and regexp |
2242 ok = self.findFirst( |
2246 ok = self.findFirst( |
2243 txt, regexp, caseSensitive, wholeWord, True, forward=True, |
2247 txt, regexp, caseSensitive, wholeWord, True, forward=True, |
2244 posix=regexp) |
2248 posix=posixMode, cxx11=cxx11Mode) |
2245 self.searchStringFound.emit(ok) |
2249 self.searchStringFound.emit(ok) |
2246 |
2250 |
2247 def __searchPrev(self): |
2251 def __searchPrev(self): |
2248 """ |
2252 """ |
2249 Private method to search for the next occurrence. |
2253 Private method to search for the next occurrence. |
2269 self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) |
2273 self.__lastSearch = (txt, caseSensitive, wholeWord, regexp) |
2270 if self.hasSelectedText(): |
2274 if self.hasSelectedText(): |
2271 line, index = self.getSelection()[:2] |
2275 line, index = self.getSelection()[:2] |
2272 else: |
2276 else: |
2273 line, index = -1, -1 |
2277 line, index = -1, -1 |
|
2278 posixMode = Preferences.getEditor("SearchRegexpMode") == 0 and regexp |
|
2279 cxx11Mode = Preferences.getEditor("SearchRegexpMode") == 1 and regexp |
2274 ok = self.findFirst( |
2280 ok = self.findFirst( |
2275 txt, regexp, caseSensitive, wholeWord, True, |
2281 txt, regexp, caseSensitive, wholeWord, True, |
2276 forward=False, line=line, index=index, posix=regexp) |
2282 forward=False, line=line, index=index, posix=posixMode, |
|
2283 cxx11=cxx11Mode) |
2277 self.searchStringFound.emit(ok) |
2284 self.searchStringFound.emit(ok) |
2278 |
2285 |
2279 def historyStyle(self): |
2286 def historyStyle(self): |
2280 """ |
2287 """ |
2281 Public method to get the shell history style. |
2288 Public method to get the shell history style. |