Permalink
Browse files

Fix #4615 - vim highlighting fails on slashes and colons.

When a regexp is used in a selector, vim shouldn't choke if more than one slash
is found on the same line.

This patch also adds support for colons in attribute names.
  • Loading branch information...
1 parent f0e41e2 commit 60069641a7b1a223be5210e2d1229651e9ab65e9 @mfournier mfournier committed with jamtur01 Aug 25, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 syntax/puppet.vim
View
@@ -57,14 +57,14 @@ syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fai
" rvalues
syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
-syn match puppetVariable "$\w\+"
-syn match puppetVariable "${\w\+}"
+syn match puppetVariable "$[a-zA-Z0-9_:]\+"
+syn match puppetVariable "${[a-zA-Z0-9_:]\+}"
" match anything between simple/double quotes.
" don't match variables if preceded by a backslash.
syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+
syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
-syn match puppetString "/.*/"
+syn match puppetString "/[^/]*/"
syn match puppetNotVariable "\\$\w\+" contained
syn match puppetNotVariable "\\${\w\+}" contained

0 comments on commit 6006964

Please sign in to comment.