cakebaker / scss-syntax.vim

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

Conflict with IndentLine plugin #38

Closed kristijanhusak closed 10 years ago

kristijanhusak commented 10 years ago

Today i installed this plugin https://github.com/Yggdroot/indentLine because i wanted some indent guidelines. The plugin works fine with all filetypes except the scss. I posted an issue on that plugin repo here https://github.com/Yggdroot/indentLine/issues/75, but i didn't notice any problems in other filetypes, so i guess it's issue in the scss syntax highlighting, not in a plugin itself. Can this be fixed easily somehow?

cakebaker commented 10 years ago

Yes, this is an issue with some regex in scss.vim.

kristijanhusak commented 10 years ago

Can it be fixed somehow?

kristijanhusak commented 10 years ago

I found a fix for this, but i'm not sure if it will break something else because i'm not so good in writing syntax highlighting scripts. here https://github.com/cakebaker/scss-syntax.vim/blob/master/syntax/scss.vim#L38 if i remove \s* from the beginning of the line, we get this

syn match scssSelector "^\zs\([^:@]\|:[^ ]\)\+{\@=" contained contains=@scssSelectors

I know that \s* matches spaces, but i think that the matching of spaces is already done in \zs part. As i said, not 100% if this is ok, but if it is, i'll create PR.

cakebaker commented 10 years ago

Yes, please create a PR. Your solution is cleaner than what I came up with:

syn match scssSelector "\s*\zs\([^:@]\|:[^ ]\)\+\ze{\@=" contained contains=@scssSelectors

Both regexes produce the same syntax highlighting of example.scss, without breaking anything there.

cakebaker commented 10 years ago

Thanks for reporting and your PR.

kristijanhusak commented 10 years ago

No problem ;)