cakebaker / scss-syntax.vim

Vim syntax file for scss (Sassy CSS)
386 stars 71 forks source link

Incorrect highlighting for commented selector #62

Closed alem0lars closed 9 years ago

alem0lars commented 9 years ago

If you try to comment a selector, the comment syntax isn't recognized.. See the screenshots below:

screen shot 2015-03-30 at 11 21 38 screen shot 2015-03-30 at 11 21 55

Thanks

cakebaker commented 9 years ago

Hm, I'm unable to reproduce the issue here. Is this code snippet inside another element like e.g. a mixin? And what is shown for the incorrectly highlighted comment when you add the following two lines to your .vimrc?

set laststatus=2
set statusline+=%{synIDattr(synID(line('.'),col('.'),1),'name')}
alem0lars commented 9 years ago

Both in the line //html##{$ns} { and // abbr:hover { gives me:

screen shot 2015-03-31 at 08 36 16

PS: I'm not sure but it seems that highlighting breaks only when using comments in selectors... Maybe something is wrong/incompatible with matching those? IDK

Thanks

cakebaker commented 9 years ago

Thanks, though I'm still unable to reproduce it :|

alem0lars commented 9 years ago

Try with this file:

@charset "utf-8";

// {{{ Public methods.

//
// Apply clearfix after all children elements.
//
@mixin clearfix() {
  //&:after {
  //  display:    block;
  //  height:     0;
  //  clear:      both;
  //  font-size:  0;
  //  content:    " ";
  //  visibility: hidden;
  //}
}

//
// Apply floating to the enclosing element.
//
@mixin float() {
  float: left;
}

// }}}

The line //&:after { should be incorrectly highlighted

cakebaker commented 9 years ago

It works fine here.

Is it possible you're using an older version of the syntax file? If I undo a change made for #60 (commit https://github.com/cakebaker/scss-syntax.vim/commit/be70ea8d205660b5fb67fd6a37b43d626b1ebe29) I get the issues you describe.

cakebaker commented 9 years ago

Closing this ticket as I think it's a duplicate of #60. Please re-open if the issue still exists.