--- a/src/eric7/EricGui/EricGenericDiffHighlighter.py Tue Dec 19 11:04:03 2023 +0100 +++ b/src/eric7/EricGui/EricGenericDiffHighlighter.py Tue Dec 19 19:57:08 2023 +0100 @@ -18,8 +18,10 @@ """ Function to mark a pattern as the final one to search for. - @param pattern pattern to be marked (string) - @return marked pattern (string) + @param pattern pattern to be marked + @type str + @return marked pattern + @rtype str """ return "__TERMINAL__:{0}".format(pattern) @@ -37,7 +39,8 @@ """ Constructor - @param doc reference to the text document (QTextDocument) + @param doc reference to the text document + @type QTextDocument """ super().__init__(doc) @@ -60,7 +63,8 @@ Public method to create the highlighting rules. @param rules set of highlighting rules (list of tuples of rule - pattern (string) and highlighting format (QTextCharFormat)) + pattern and highlighting format) + @type set of tuple of (str, QTextCharFormat) """ for _idx, ruleFormat in enumerate(rules): rule, formats = ruleFormat @@ -78,9 +82,11 @@ Public method to determine the highlighting formats for a line of text. - @param line text line to be highlighted (string) + @param line text line to be highlighted + @type str @return list of matched highlighting rules (list of tuples of match - object and format (QTextCharFormat)) + object and format) + @rtype list of tuple of (re.Match, QTextCharFormat) """ matched = [] for rx, formats, terminal in self._rules: @@ -97,10 +103,14 @@ """ Public method to generate a format definition. - @param fg foreground color (QColor) - @param bg background color (QColor) - @param bold flag indicating bold text (boolean) - @return format definiton (QTextCharFormat) + @param fg foreground color + @type QColor + @param bg background color + @type QColor + @param bold flag indicating bold text + @type bool + @return format definiton + @rtype QTextCharFormat """ font = Preferences.getEditorOtherFonts("MonospacedFont") charFormat = QTextCharFormat() @@ -122,7 +132,8 @@ """ Public method to highlight a block of text. - @param text text to be highlighted (string) + @param text text to be highlighted + @type str """ formats = self.formats(text) if not formats: