Better-CSS-Syntax-for-Vim icon indicating copy to clipboard operation
Better-CSS-Syntax-for-Vim copied to clipboard

@media groups not highlighted properly

Open amadeus opened this issue 12 years ago • 2 comments
trafficstars

It appears that any @media stuff within the opening { and closing } are not initially highlighted correctly because it's interpreted as cssPropRegion.

This sort of fixes itself after that first rule set since the closing } closes the cssPropRegion. However, it means the final closing } of the @media group is then not highlighted at all since it's just considered arbitrary text.

I don't know Vim syntax API well enough to fix this quickly, the only way I can think of is a hefty re-write of how cssPropRegion is defined.

amadeus avatar Jun 19 '13 05:06 amadeus

Here's an included snippet that will show the error:

@media screen {
    .someClass {
        display:none;
    }
}

amadeus avatar Jun 19 '13 06:06 amadeus

it means the final closing } of the @media group is then not highlighted at all since it's just considered arbitrary text

It's because cssFuncRegion can't work with nested regions: it only work well with single level.

Honestly, this script needs a full re-write to make it work better, but VimL doesn't match my expectation. That's why I stopped updating it. I'm waiting for the next Vim with Python.

chrisyip avatar Jun 19 '13 07:06 chrisyip