QScintilla/Editor.py

changeset 4304
f85965649066
parent 4302
748f4945462b
child 4376
7847a37ee71d
--- a/QScintilla/Editor.py	Wed Jul 01 19:34:51 2015 +0200
+++ b/QScintilla/Editor.py	Fri Jul 03 19:07:06 2015 +0200
@@ -234,6 +234,7 @@
             Preferences.getEditor("MarkOccurrencesTimeout"))
         self.__markOccurrencesTimer.timeout.connect(self.__markOccurrences)
         self.__markedText = ""
+        self.__searchIndicatorLines = []
         
         # initialize some spellchecking stuff
         self.spell = None
@@ -3351,6 +3352,9 @@
         @param indicLength length of the indicator (integer)
         """
         self.setIndicatorRange(self.searchIndicator, startPos, indicLength)
+        line = self.lineIndexFromPosition(startPos)[0]
+        if line not in self.__searchIndicatorLines:
+            self.__searchIndicatorLines.append(line)
         
     def clearSearchIndicators(self):
         """
@@ -3358,6 +3362,8 @@
         """
         self.clearAllIndicators(self.searchIndicator)
         self.__markedText = ""
+        self.__searchIndicatorLines = []
+        self.__markerMap.update()
         
     def __markOccurrences(self):
         """
@@ -3379,6 +3385,21 @@
             self.setSearchIndicator(tgtPos, tgtLen)
             ok = self.findNextTarget()
         self.__markedText = word
+        self.__markerMap.update()
+    
+    def getSearchIndicatorLines(self):
+        """
+        Public method to get the lines containing a search indicator.
+        
+        @return list of lines containing a search indicator (list of integer)
+        """
+        return self.__searchIndicatorLines[:]
+    
+    def updateMarkerMap(self):
+        """
+        Public method to initiate an update of the marker map.
+        """
+        self.__markerMap.update()
     
     ###########################################################################
     ## Comment handling methods below

eric ide

mercurial