Home ⌂Doc Index ◂Up ▴

eric6.E5Gui.E5GenericDiffHighlighter

Module implementing a syntax highlighter for diff outputs.

Global Attributes

_REGEX_CACHE

Classes

E5GenericDiffHighlighter Class implementing a generic diff highlighter.

Functions

TERMINAL Function to mark a pattern as the final one to search for.


E5GenericDiffHighlighter

Class implementing a generic diff highlighter.

Derived from

QSyntaxHighlighter

Class Attributes

None

Class Methods

None

Methods

E5GenericDiffHighlighter Constructor
__initColours Private method to initialize the highlighter colours.
createRules Public method to create the highlighting rules.
formats Public method to determine the highlighting formats for a line of text.
generateRules Public method to generate the rule set.
highlightBlock Public method to highlight a block of text.
makeFormat Public method to generate a format definition.
regenerateRules Public method to initialize or regenerate the syntax highlighter rules.

Static Methods

None

E5GenericDiffHighlighter (Constructor)

E5GenericDiffHighlighter(doc)

Constructor

doc
reference to the text document (QTextDocument)

E5GenericDiffHighlighter.__initColours

__initColours()

Private method to initialize the highlighter colours.

E5GenericDiffHighlighter.createRules

createRules(*rules)

Public method to create the highlighting rules.

rules
set of highlighting rules (list of tuples of rule pattern (string) and highlighting format (QTextCharFormat))

E5GenericDiffHighlighter.formats

formats(line)

Public method to determine the highlighting formats for a line of text.

line
text line to be highlighted (string)
Returns:
list of matched highlighting rules (list of tuples of match object and format (QTextCharFormat))

E5GenericDiffHighlighter.generateRules

generateRules()

Public method to generate the rule set.

Note: This method must me implemented by derived syntax highlighters.

E5GenericDiffHighlighter.highlightBlock

highlightBlock(text)

Public method to highlight a block of text.

text
text to be highlighted (string)

E5GenericDiffHighlighter.makeFormat

makeFormat(fg=None, bg=None, bold=False)

Public method to generate a format definition.

fg
foreground color (QColor)
bg
background color (QColor)
bold
flag indicating bold text (boolean)
Returns:
format definiton (QTextCharFormat)

E5GenericDiffHighlighter.regenerateRules

regenerateRules()

Public method to initialize or regenerate the syntax highlighter rules.

Up


TERMINAL

TERMINAL(pattern)

Function to mark a pattern as the final one to search for.

pattern
pattern to be marked (string)
Returns:
marked pattern (string)
Up



Home ⌂Doc Index ◂Up ▴