Skip to content
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

Syntax highlighting seems incomplete or somehow broken for me #34

Closed
sockdrawermoney opened this issue Mar 6, 2014 · 16 comments · Fixed by #39
Closed

Syntax highlighting seems incomplete or somehow broken for me #34

sockdrawermoney opened this issue Mar 6, 2014 · 16 comments · Fixed by #39

Comments

@sockdrawermoney
Copy link

I just installed vim-stylus and the syntax highlighting doesn't seem right to me:

My guess is that there's more syntax highlighting that should be going on than just that.

It's possible—if not likely—that something is borked for me, but I just installed vim-jade and it's working great, as are the rest of my syntax highlighting and configurations.

@wavded
Copy link
Owner

wavded commented Mar 6, 2014

thanks for the report @adambrault, that does look a little borked, what is the result of this file?:

https://github.com/wavded/vim-stylus/blob/master/test.styl

still nasty?

@nicknisi
Copy link

nicknisi commented Apr 1, 2014

I'm seeing the same issue. Here is a screenshot of what test.styl looks like for me
screen shot 2014-03-31 at 7 41 38 pm

@wavded
Copy link
Owner

wavded commented Apr 1, 2014

I have an incredibly minimalist vim theme, what theme do you have? maybe i'm not seeing enough colors

@nicknisi
Copy link

nicknisi commented Apr 1, 2014

I am using https://github.com/w0ng/vim-hybrid. The problem seems to be very noticeable with nested rules.
screen shot 2014-03-31 at 9 01 55 pm

@nicknisi
Copy link

nicknisi commented Apr 5, 2014

I used git bisect to track down the commit that introduced this issue and it points to 456019a. Reverting these changes makes my stylus files look more like this:
screen shot 2014-04-05 at 9 24 59 am

@wavded
Copy link
Owner

wavded commented Apr 5, 2014

something else seems to be amiss, my test.styl file is fine at the current release, this is using the hybrid theme. stylus does depend on css.vim being current on your vim install, what release of vim are you on? that particular commit you referenced fixed the require line up top of the test.styl file from commenting the rest of the file.

screen shot 2014-04-05 at 1 15 46 pm

@nicknisi
Copy link

nicknisi commented Apr 6, 2014

I'm running vim 7.4.52

@wavded
Copy link
Owner

wavded commented Apr 6, 2014

ok, i'll try to update, did you install through brew? -- I think I've got the default one on Mavericks:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 24 2013 18:58:47)
Compiled by root@apple.com

@nicknisi
Copy link

nicknisi commented Apr 6, 2014

Yes, I'm running Mavericks and run the terminal vim that comes with MacVim. I installed it from homebrew by running brew install macvim --override-system-vim. Thanks for the help!

@wavded
Copy link
Owner

wavded commented Apr 18, 2014

@nicknisi sorry for my late response on this, whilst running 7.4.52, it still shows up just like the screenshot above... not sure what else I can try, sorry about that

@webdesserts
Copy link

I am having the same issue. My stylus is highlighted very similarly to the way that @nicknisi's is in his second image. It seems like the brackets are killing the highlighting.

@itchyny
Copy link
Contributor

itchyny commented May 21, 2014

The problem is

syn match stylusImportList "[^;]\+" contained contains=cssString.*,cssMediaType,cssURL

It specifies contained, but note that the pattern is "[^;]\+", which matches anywhere.
And cssDefineBlock is defined as the following

syn region cssDefineBlock start="{" end="}" transparent contains=ALL

which unexpectedly contains stylusImportList.
It breaks the syntax.

wavded added a commit that referenced this issue May 22, 2014
improve cssDefineBlock: do not contain stylusImportList (rel #34)
@wavded
Copy link
Owner

wavded commented May 22, 2014

confirmed, this patch looks good to me, i've merged it in. thanks @itchyny , if anyone has any issues or confirmations to add, please comment.

@nicknisi
Copy link

Just updated and it looks great! Thanks!

@webdesserts
Copy link

Working for me as well now :) Thanks for the patch.

@arnauddri
Copy link

Hi,

I am using Cobalt color theme and I get the same problem, even with the fix:
screen shot 2014-10-21 at 10 35 17

I have tried using other color themes but I still get the same problem.
Is there anything else which could cause this highlighting problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants