Skip to content

Commit fcb7a6f

Browse files
authored
Fixed the color highlight for self and fixed some invalid escape sequences (#550)
1 parent 6d88ada commit fcb7a6f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

cq_editor/widgets/pyhighlight.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def format(color, style=""):
2828
"string": format("orange"),
2929
"string2": format("darkMagenta"),
3030
"comment": format("darkGreen", "italic"),
31-
"self": format("black", "italic"),
31+
"self": format("blue", "italic"),
3232
"numbers": format("magenta"),
3333
}
3434

@@ -85,36 +85,36 @@ class PythonHighlighter(QSyntaxHighlighter):
8585
">",
8686
">=",
8787
# Arithmetic
88-
"\+",
88+
r"\+",
8989
"-",
90-
"\*",
90+
r"\*",
9191
"/",
9292
"//",
93-
"\%",
94-
"\*\*",
93+
r"\%",
94+
r"\*\*",
9595
# In-place
96-
"\+=",
96+
r"\+=",
9797
"-=",
98-
"\*=",
98+
r"\*=",
9999
"/=",
100-
"\%=",
100+
r"\%=",
101101
# Bitwise
102-
"\^",
103-
"\|",
104-
"\&",
105-
"\~",
102+
r"\^",
103+
r"\|",
104+
r"\&",
105+
r"\~",
106106
">>",
107107
"<<",
108108
]
109109

110110
# Python braces
111111
braces = [
112-
"\{",
113-
"\}",
114-
"\(",
115-
"\)",
116-
"\[",
117-
"\]",
112+
r"\{",
113+
r"\}",
114+
r"\(",
115+
r"\)",
116+
r"\[",
117+
r"\]",
118118
]
119119

120120
def __init__(self, parent=None):

0 commit comments

Comments
 (0)