Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Syntax structure incompatible with extended syntaxes (eg less) #51

Closed
GoogleCodeExporter opened this issue Aug 18, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

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)


Original issue reported on code.google.com by tver...@gmail.com on 3 Feb 2012 at 11:52

Attachments:

@GoogleCodeExporter
Copy link
Author

the support of css3 syntax is also needed

Original comment by w.jq0...@gmail.com on 16 Aug 2012 at 5:09

@GoogleCodeExporter
Copy link
Author

This should be taken to the maintainer of the syntax file. As of Vim 7.4.460, 
the maintainers repository seems to be https://github.com/JulesWang/css.vim
The maintainer will then send new Vim runtime files to Bram for inclusion with 
Vim. Therefore closing.

Original comment by chrisbr...@googlemail.com on 30 Sep 2014 at 9:34

  • Changed state: WontFix

@GoogleCodeExporter
Copy link
Author

Hi, 
We have noticed this issue: https://GitHub.com/juleswang/css.vim/pull/38

There are two options to fix this issue:

1. The maintainer of less.vim etc update their files to keep up with CSS.vim. 
Or give me feedback.

2. I become the maintainer of less.vim etc. When I update CSS.vim I will update 
less.vim as well.

Original comment by w.jq0...@gmail.com on 30 Sep 2014 at 10:07

@GoogleCodeExporter
Copy link
Author

It seems there is no less.vim syntax or filetype plugin in Vims runtime file 
available. If you like to contribute, sends your files for inclusion to Bram. 
He will then include it with the runtime files of Vim.

Original comment by chrisbr...@googlemail.com on 30 Sep 2014 at 6:09

@GoogleCodeExporter
Copy link
Author

Original comment by chrisbr...@googlemail.com on 30 Sep 2014 at 9:18

  • Added labels: Runtime
  • Removed labels: Priority-Medium, Type-Defect

@GoogleCodeExporter
Copy link
Author

You are right, there is no less.vim in vim. That's surprising, I will commit 
one.

Original comment by w.jq0...@gmail.com on 8 Oct 2014 at 1:38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant