rodjek / vim-puppet

Puppet niceties for your Vim setup
Apache License 2.0
500 stars 137 forks source link

Slashes in pathnames confuse the highlighting #120

Open petdance opened 4 years ago

petdance commented 4 years ago

I ran facter > foo.pp and then vim foo.pp to take a look at it. The section on mountpoints had incorrect highlighting because of slashes in the paths. The first mountpoint is highlighted correctly, but the second is not.

Screen Shot 2019-11-14 at 3 25 29 PM

In the screenshot above, I put the / in quotes as "/" to make it highlight correctly, but left the /boot unquoted so that it messes up the highlighting.

rodjek commented 4 years ago

In my opinion, this is the expected behaviour. /boot is not a valid bare string so it's highlighting it as a multiline regex, which is also how Puppet treats it

$ puppet parser validate test.pp
Error: Could not parse for environment production: Syntax error at '/' (file: /home/tsharpe/code/rodjek/rspec-puppet/test.pp, line: 2, column: 3)
$ cat test.pp
$foo = {
  /boot => 'bar',
}