Wrong parentheses color pairing
apetri opened this issue · 3 comments
Hi Matt, I am using your Neon Color Scheme package, and it works great. I noticed however some strange behavior when coloring certain kinds of parentheses, in particular:
- Using syntax coloring for C, the parentheses in this line
int endianness = getHeader(fp,&header);
are colored wrong: the left parenthesis gets a green color, while the right one remains white. This happens with every custom defined function (not for system calls that are colored differently) - With the latest release of Neon that I got today, using the PythonImproved syntax coloring, this line gets strange colors
table = np.zeros((n+1,k+1),dtype=np.int)
the inner parentheses, (n+1,k+1), don't match in color, and furthermore the 'dtype' keyword argument is not colored as such (i.e. it remains white). Can I help in fixing these? Best
Andrea
Hi Andrea,
Thank you for your feedback. First, regarding Neon and PythonImproved - I released a new version of PythonImproved last night that had a significant bug in it. I've now released a fixed version which has just showed up on Package Control, so just go to Command Palette -> Package Control: Upgrade Package -> PythonImproved
and the Python highlighting should be back to normal.
Which syntax are you using for your C code? When I enter your line using the built-in C syntax, the only thing that gets highlighted is int
. Could you post a larger section of your code, and a screenshot of what you're seeing?
Hi Matt, thank you for your support! The first bug is fixed with the new version of PythonImproved. Regarding the C issue, you're right, when you punch in that line the only highlighting is 'int' but when you do the following
There is a parentheses mismatch in the 'getHeader method'... any clue on what might be happening?
Yup - this is an error in the C syntax definition (one of many, I'm afraid). If you want to fix it, either browse to Packages/C++/C.tmLanguage
(ST2) or install PackageResourceViewer
, select PackageResourceViewer: Open Resource
from the Command Palette, and select C++ -> C.tmLanguage
(ST3). Either way, set the syntax to XML for highlighting. Scroll down to line 567:
\s*(\()</string>
and change the regex to \s*\(
(basically, remove the parens from around the escaped paren). Save the file, and you should be all set.
I encourage you to look for other C syntaxes, as the one that ships with Sublime is pretty bad. There are some on Package Control, and others just floating around, so have a look and find one that looks good to you. If you think it has some scopes that aren't (or are incorrectly) themed by Neon, just let me know.