Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 51 by [email protected]: CSS Syntax structure incompatible with extended syntaxes (eg less)
http://code.google.com/p/vim/issues/detail?id=51

The LESS dynamic stylesheet language extends CSS syntax.
A syntax file has been created for LESS - https://github.com/groenewege/vim-less that loads the standard CSS syntax, and then adds less specific constructs.

However, the way that css.vim is structured creates an incompatibility. Because "font" is both a valid HTML tag, and the prefix to several valid css properties (font-family, font-size, etc), less.vim has an ambiguity and matches "font-size" as a tag followed by raw text, rather than a css property.

I can't determine any way to fix this in the less.vim syntax, I believe it needs to be done in css.vim

What steps will reproduce the problem?
1. Install less.vim from here : https://github.com/groenewege/vim-less
2. Create a vim buffer with
BODY
{
  font-size: 10pt;
}
3. Turn syntax highlighting on.
4. Set the filetype to 'css' - "font-size" will match as a CSS property
5. Set the filetype to 'less' - "font-size" will not as a CSS property, but "font" will match as a tag

What is the expected output? What do you see instead?
When the syntax is set to less, font-size should be a CSS property.

What version of the product are you using? On what operating system?
7.3(53) - MacVim
But the problem exists in mercurial tip

Please provide any additional information below.
A patch is supplied to change css.vim so that the "font" tag will match a whole-word only.
This then creates the correct result in less.vim.
I don't think this problem can be resolved directly in less.vim

It appears that the css.vim maintainer is no longer active - the version of css.vim from his website is quite old, and the vim repo has started to include changes from other places (e.g. http://code.google.com/p/vim/issues/detail?id=6)



Attachments:
        css.vim.patch  1.2 KB

--
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui