232 self.__markOccurrencesTimer.setSingleShot(True) |
232 self.__markOccurrencesTimer.setSingleShot(True) |
233 self.__markOccurrencesTimer.setInterval( |
233 self.__markOccurrencesTimer.setInterval( |
234 Preferences.getEditor("MarkOccurrencesTimeout")) |
234 Preferences.getEditor("MarkOccurrencesTimeout")) |
235 self.__markOccurrencesTimer.timeout.connect(self.__markOccurrences) |
235 self.__markOccurrencesTimer.timeout.connect(self.__markOccurrences) |
236 self.__markedText = "" |
236 self.__markedText = "" |
|
237 self.__searchIndicatorLines = [] |
237 |
238 |
238 # initialize some spellchecking stuff |
239 # initialize some spellchecking stuff |
239 self.spell = None |
240 self.spell = None |
240 self.lastLine = 0 |
241 self.lastLine = 0 |
241 self.lastIndex = 0 |
242 self.lastIndex = 0 |
3349 |
3350 |
3350 @param startPos start position of the indicator (integer) |
3351 @param startPos start position of the indicator (integer) |
3351 @param indicLength length of the indicator (integer) |
3352 @param indicLength length of the indicator (integer) |
3352 """ |
3353 """ |
3353 self.setIndicatorRange(self.searchIndicator, startPos, indicLength) |
3354 self.setIndicatorRange(self.searchIndicator, startPos, indicLength) |
|
3355 line = self.lineIndexFromPosition(startPos)[0] |
|
3356 if line not in self.__searchIndicatorLines: |
|
3357 self.__searchIndicatorLines.append(line) |
3354 |
3358 |
3355 def clearSearchIndicators(self): |
3359 def clearSearchIndicators(self): |
3356 """ |
3360 """ |
3357 Public method to clear all search indicators. |
3361 Public method to clear all search indicators. |
3358 """ |
3362 """ |
3359 self.clearAllIndicators(self.searchIndicator) |
3363 self.clearAllIndicators(self.searchIndicator) |
3360 self.__markedText = "" |
3364 self.__markedText = "" |
|
3365 self.__searchIndicatorLines = [] |
|
3366 self.__markerMap.update() |
3361 |
3367 |
3362 def __markOccurrences(self): |
3368 def __markOccurrences(self): |
3363 """ |
3369 """ |
3364 Private method to mark all occurrences of the current word. |
3370 Private method to mark all occurrences of the current word. |
3365 """ |
3371 """ |
3377 while ok: |
3383 while ok: |
3378 tgtPos, tgtLen = self.getFoundTarget() |
3384 tgtPos, tgtLen = self.getFoundTarget() |
3379 self.setSearchIndicator(tgtPos, tgtLen) |
3385 self.setSearchIndicator(tgtPos, tgtLen) |
3380 ok = self.findNextTarget() |
3386 ok = self.findNextTarget() |
3381 self.__markedText = word |
3387 self.__markedText = word |
|
3388 self.__markerMap.update() |
|
3389 |
|
3390 def getSearchIndicatorLines(self): |
|
3391 """ |
|
3392 Public method to get the lines containing a search indicator. |
|
3393 |
|
3394 @return list of lines containing a search indicator (list of integer) |
|
3395 """ |
|
3396 return self.__searchIndicatorLines[:] |
|
3397 |
|
3398 def updateMarkerMap(self): |
|
3399 """ |
|
3400 Public method to initiate an update of the marker map. |
|
3401 """ |
|
3402 self.__markerMap.update() |
3382 |
3403 |
3383 ########################################################################### |
3404 ########################################################################### |
3384 ## Comment handling methods below |
3405 ## Comment handling methods below |
3385 ########################################################################### |
3406 ########################################################################### |
3386 |
3407 |