This commit is contained in:
Kovid Goyal 2019-12-15 18:19:32 +05:30
parent c7f8350eca
commit 8c382e7e4f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -871,13 +871,14 @@ class PythonHighlighter(QSyntaxHighlighter): # {{{
("error", "#FF0000", False, False),
("pyqt", "#50621A", False, False)):
format = QTextCharFormat(baseFormat)
fmt = QTextCharFormat(baseFormat)
if color is not None:
format.setForeground(QColor(color))
fmt.setForeground(QColor(color))
if bold:
format.setFontWeight(QFont.Bold)
format.setFontItalic(italic)
cls.Formats[name] = format
fmt.setFontWeight(QFont.Bold)
if italic:
fmt.setFontItalic(italic)
cls.Formats[name] = fmt
def highlightBlock(self, text):
NORMAL, TRIPLESINGLE, TRIPLEDOUBLE, ERROR = range(4)