Sublime Forum

Why is my python syntax ugly?

#1

Hello!

I am learning to write plugins, and Python is not my fluency. This is made more difficult by the odd syntax highlighting behavior I’m seeing, which makes me make frequent whitespace and bracket mistakes.

Here’s what it looks like:
skitch.com/robotron2086/gisfn/p … y-wordgame

And looking at other python files, there is no issue (this is from the Default package):
skitch.com/robotron2086/gisfh/d … y-wordgame

Any thoughts as to why this is occuring?

Thanks

0 Likes

#2

Do you have the package BracketHighlighter or SublimeTags or SublimeBrackets installed? If it does, does it help to disable them temporarily?

You can include the following in Packages/User/Global.sublime-settings:

{
    ...other settings...
    "ignored_packages": "BracketHighlighter", ...more ignored packages...],
    ...more settings...
}
0 Likes

#3

He has probably installed SublimeLinter.
It essentially is giving you hints on potential errors and guiding you to conform to defined programming styles.
When you move the selector within a selection SublimeLinter displays the hint in the footer of the editor (right next to Line, Column info ).

more info: https://github.com/Kronuz/SublimeLinter

0 Likes

#4

SublimeLinter is trying to help you conform to python coding standards. As someone pointed out, if you click on a line that is outlined, the error is shown in the status bar. In this case your problem is that you are using tabs instead of spaces for indentation. Switch to spaces.

0 Likes

#5

[quote=“hibbelig”]Do you have the package BracketHighlighter or SublimeTags or SublimeBrackets installed? If it does, does it help to disable them temporarily?

You can include the following in Packages/User/Global.sublime-settings:

{ ...other settings... "ignored_packages": "BracketHighlighter", ...more ignored packages...], ...more settings... } [/quote]

BracketHighlighter has nothing to do with this issue; it only highlights brackets. As stated earlier, this is SublimeLinter marking lines that violate certain PEP8 rules. You need to either conform to the SublimeLinter rules or exclude the rules you do not wish to follow.

0 Likes

#6

Wow, you are quite correct, it was the linter! I had forgotten I had installed that. Thank you for enlightening me, very cool little prog.

0 Likes

#7

Yes, sorry. Thanks for setting me straight.

0 Likes

#8

No worries :smile:. With the dynamics of multiple plugins, it can be very easy to attribute issues to the wrong plugin.

0 Likes