Skip to content

Commit 449fbff

Browse files
Make use of the update constant color for highlighting special functions and attributes
(__file__, __init__,...) also highlight [True, False, None] as keyword and not as builtins
1 parent d158b02 commit 449fbff

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pyqode/python/modes/sh.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def make_python_patterns(additional_keywords=[], additional_builtins=[]):
6363
kw = r"\b" + any("keyword", kwlist + additional_keywords) + r"\b"
6464
builtinlist = [str(name) for name in dir(builtins)
6565
if not name.startswith('_')] + additional_builtins
66+
for v in ['None', 'True', 'False']:
67+
builtinlist.remove(v)
6668
builtin = r"([^.'\"\\#]\b|^)" + any("builtin", builtinlist) + r"\b"
6769
builtin_fct = any("builtin_fct", [r'_{2}[a-zA-Z_]*_{2}'])
6870
comment = any("comment", [r"#[^\n]*"])
@@ -173,7 +175,7 @@ def highlight_block(self, text, block):
173175
# trick to highlight __init__, __add__ and so on with
174176
# builtin color
175177
self.setFormat(start, end - start,
176-
self.formats["builtin"])
178+
self.formats["constant"])
177179
else:
178180
if '"""' in value and key != 'comment':
179181
# highlight docstring with a different color

0 commit comments

Comments
 (0)