jesseweed / seti-syntax

A subtle dark colored theme for Atom.
MIT License
185 stars 66 forks source link

space between function name and bracket #19

Open wchichih opened 9 years ago

wchichih commented 9 years ago

screenshot from 2014-10-29 23 21 53

In C++, if there is a space between function name and bracket, then two brackets' color will be different. Will it be solve or not

karloluis commented 9 years ago

This should be an easy fix. Hopefully the team picks it up and patches it soon. +1

jesseweed commented 9 years ago

So the issue seems to be that where there's a space between the if and the paren, atom wrap it in a span with additional classes "punctuation definition parameters c":

<span class="punctuation definition parameters c”>(</span>

here's the if block with no space:

<span class="source c++"><span class="meta block c"><span class="leading-whitespace indent-guide">  </span>
<span class="keyword control c">if</span>(k === w-&gt;key) <span class="meta block c"><span class="punctuation section block begin c">{</span></span>
</span>
</span>

and with the space:

<span class="source c++"><span class="meta block c"><span class="leading-whitespace indent-guide">  </span><span class="keyword control c">if</span><span class="meta initialization c"> <span class="punctuation definition parameters c">(</span></span>k
=== w-&gt;key) <span class="meta block c"><span class="punctuation section block begin c">{</span></span>
</span>
</span>

I'm not actually sure how best to resolve this. It's the ".punctuation.definition.parameters" class that adds the blue color, which is there with a space, and not otherwise. If this isn't correct behavior, I would file a bug in the Atom repo and see what those guys think.

However, if there should be a differentiation between space and not and it's it's just weird to have them different colors I can push a fix to make .punctuation.definition.parameters white in c.

@alim0x @karloluis: thoughts?

asantos3 commented 9 years ago

You can't do much to solve it so I think the best approach is to report it and wait for it to be fixed.

jameslzhu commented 9 years ago

I managed to track down the exact problem. I've submitted a pull request to the language-c repo here:

https://github.com/atom/language-c/pull/62

tl;dr it's a stray question mark causing the pattern ( to be matched (whitespace and parenthesis).

This should also fix #3.

asantos3 commented 9 years ago

Awesome @jzhu98, keep up the good work ;)