"less" syntax highlighting error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"less" syntax highlighting error

Ti Strga
Using 8.0.596, playing with the Less markup language for the first
time (a preprocessor producing CSS for a webserver).  The regular
expression controlling comment blocks has gone a bit wrong.  I'm
cc'ing Alessandro Vioni, listed as the maintainer in that file.

In CSS, one can use C-style comments as blocks, which is useful for
disabling chunks:

   /* blah blah blah this CSS didn't work so I disabled it
      but am keeping it around because blah blah blah
      some #kind of .selector {
          awesome-factor: 9000;
      }*/

And in Vim, it all turns the standard "comment block" color.

In Less, the same comment rules apply, but after the opening delimiter,
Vim only shows the rest of that same line as a comment.  Using the
example above, this is "comment block" color:

   /* blah blah blah this CSS didn't work so I disabled it

but this is all colored according to normal syntax rules:

      but am keeping it around because blah blah blah
      some #kind of .selector {
          awesome-factor: 9000;
      }*/

and of course it goes nuts.  If that "but am keeping" line happens to
contain a single-quote, for example, the entire rest of the file turns
"quoted text" color.

I looked very briefly at less.vim's "syn region" lines for comment blocks,
but it's trying to do something more clever than the plain 'cssComment'
region block.  I see something handling end-of-line '//' comments, but I
am ignorant of the rest of the syntax there or what its goal might be; it's
been too long since I studied vimscript.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...