GNOME Bugzilla – Bug 756699
Wrong highlighting of Python keywords using the themes 'Builder' or 'Builder Dark'
Last modified: 2017-06-04 22:46:39 UTC
Created attachment 313467 [details] screencast showing the bug appear after a 2nd parsing Certain Python-keywords are highlighted with the wrong color when using the highlighting-themes 'Builder' or 'Builder Dark'. For example "if" is highlighted blue like a function instead of white like a keyword. Or "from" is highlighted blue instead of dark pink. But it depends on the file which keywords fail to highlight correctly. When opening large Python files (+5k lines) the parsing gets slow enough that one can see that initially the keywords are highlighted correctly, and then switch to the wrong highlighting in a 2nd highlight parsing (See attached screencast).
This is because of Ctags highlighting. Ctags doesn't give us quite enough context to highlight correctly for all the languages. It's basically "dumb" right now and just highlights by matching words to the index.
Same things happen in CSS files when the keywords are separated by a dash and the words are found somewhere in the project. Example: .test-footer { font-size: 20px; } And either test or footer is found and highlighted differently from a CSS class.
Part of the problem, if not all, can be fixed by lowering the ctags tag priority so that we never overwrite the GtkSourceView ones.
Created attachment 353151 [details] [review] ctags: lower the tags priorities The ctags highlight tags should not overwrite the ones set by GtkSourceView.
Review of attachment 353151 [details] [review]: Sure, LGTM
Comment on attachment 353151 [details] [review] ctags: lower the tags priorities Attachment 353151 [details] pushed as 789d72f - ctags: lower the tags priorities
Tobias, it's pushed to master. Can you try either with jhbuild or flatpak once it hit the nightly if there's others cases encountered. If some, can you attach a simple reproducible case here ? In the meantime, i let the bug report open
Tried the flatpak. Looks perfect now. Thanks very much!