src/eric7/QScintilla/Editor.py

branch
eric7
changeset 9938
b8005dd4fc9b
parent 9926
6222ddc7e1bd
child 9940
a57c188857e9
child 9972
68ac01294544
--- a/src/eric7/QScintilla/Editor.py	Mon Mar 27 22:05:05 2023 +0200
+++ b/src/eric7/QScintilla/Editor.py	Tue Mar 28 10:14:23 2023 +0200
@@ -3955,6 +3955,29 @@
         self.__searchIndicatorLines = []
         self.__markerMap.update()
 
+    def highlightSearchSelection(self, startLine, startIndex, endLine, endIndex):
+        """
+        Public method to set a highlight for the selection at the start of a search.
+
+        @param startLine line of the selection start
+        @type int
+        @param startIndex index of the selection start
+        @type int
+        @param endLine line of the selection end
+        @type int
+        @param endIndex index of the selection end
+        @type int
+        """
+        self.setIndicator(
+            self.searchSelectionIndicator, startLine, startIndex, endLine, endIndex
+        )
+
+    def clearSearchSelectionHighlight(self):
+        """
+        Public method to clear all highlights.
+        """
+        self.clearAllIndicators(self.searchSelectionIndicator)
+
     def __markOccurrences(self):
         """
         Private method to mark all occurrences of the current word.
@@ -4912,6 +4935,13 @@
             Preferences.getEditorColour("HighlightMarker"),
         )
 
+        self.searchSelectionIndicator = QsciScintilla.INDIC_CONTAINER + 3
+        self.indicatorDefine(
+            self.searchSelectionIndicator,
+            QsciScintilla.INDIC_FULLBOX,
+            Preferences.getEditorColour("SearchSelectionMarker"),
+        )
+
         self.setCursorFlashTime(QApplication.cursorFlashTime())
 
         with contextlib.suppress(AttributeError):

eric ide

mercurial