13 |
13 |
14 from PyQt5.QtGui import QSyntaxHighlighter, QColor, QTextCharFormat, QFont |
14 from PyQt5.QtGui import QSyntaxHighlighter, QColor, QTextCharFormat, QFont |
15 |
15 |
16 import Preferences |
16 import Preferences |
17 |
17 |
|
18 |
18 def TERMINAL(pattern): |
19 def TERMINAL(pattern): |
19 """ |
20 """ |
20 Function to mark a pattern as the final one to search for. |
21 Function to mark a pattern as the final one to search for. |
21 |
22 |
22 @param pattern pattern to be marked (string) |
23 @param pattern pattern to be marked (string) |
23 @param return marked pattern (string) |
24 @return marked pattern (string) |
24 """ |
25 """ |
25 return "__TERMINAL__:{0}".format(pattern) |
26 return "__TERMINAL__:{0}".format(pattern) |
26 |
27 |
27 # Cache the results of re.compile for performance reasons |
28 # Cache the results of re.compile for performance reasons |
28 _REGEX_CACHE = {} |
29 _REGEX_CACHE = {} |
|
30 |
29 |
31 |
30 class E5GenericDiffHighlighter(QSyntaxHighlighter): |
32 class E5GenericDiffHighlighter(QSyntaxHighlighter): |
31 """ |
33 """ |
32 Class implementing a generic diff highlighter. |
34 Class implementing a generic diff highlighter. |
33 """ |
35 """ |