-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix builtin and keywords highlighting depending on indentation #3590
Conversation
@@ -281,9 +281,13 @@ def any(name, alternates): | |||
|
|||
def make_python_patterns(additional_keywords=[], additional_builtins=[]): | |||
"Strongly inspired from idlelib.ColorDelegator.make_pat" | |||
kw = r"\b" + any("keyword", keyword.kwlist+additional_keywords) + r"\b" | |||
kwlist = keyword.kwlist+additional_keywords |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add spaces around the +
sign here
builtinlist = [str(name) for name in dir(builtins) | ||
if not name.startswith('_')]+additional_builtins | ||
repeated = set(kwlist)&set(builtinlist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add spaces round &
Hey, nice improvement @mariacamilaremolinagutierrez! Does this also fixes the problem with |
Also, could explain what was the problem before? I mean, why coloring was not applied correctly? |
And more thing: you forgot to branch 3.x in your fork :-) I mean, you directly pushed your commits on the 3.x branch of your fork, while you should have created a branch after checking out 3.x :-) |
The problem was that the words True, False and None were in both lists: keywords and builtins. I left them to be colored as builtins. The print is not in both lists, so as another member commented on the issue, print was not a problem anymore, at least not in python 3. Next time I'll create a new branch. My apologies! |
Great, thanks a lot @mariacamilaremolinagutierrez! |
Fixes #2159