From b3c363c547dd7bf8cb54c103c20f688b9944b7da Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Mon, 7 Dec 2009 20:47:58 -0500 Subject: vim: puppetDefArguments is contained by puppetDefine The argument list for a definition must be contained, otherwise it matches too much text. For example: define test($arg) { $foo = regsubst("$name", '(.*)', '\1') # The parentheses within the above regsubst are matched as part # of puppetDefArguments and the highlighting after is incorrect. } Marking puppetDefArguments as contained by puppetDefine fixes this. Signed-off-by: Todd Zullinger --- ext/vim/syntax/puppet.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/vim/syntax') diff --git a/ext/vim/syntax/puppet.vim b/ext/vim/syntax/puppet.vim index eb62b64b8..e86138a4c 100644 --- a/ext/vim/syntax/puppet.vim +++ b/ext/vim/syntax/puppet.vim @@ -19,7 +19,7 @@ endif " match class/definition/node declarations syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe syn keyword puppetDefType class define node inherits contained -syn region puppetDefArguments start="(" end=")" contains=puppetArgument +syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument syn match puppetArgument "\w\+" contained syn match puppetArgument "\$\w\+" contained syn match puppetArgument "'[^']+'" contained -- cgit From b7b7a1c3ca9a2208b7d26964e1fa3ceb4e95f693 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Fri, 8 Jan 2010 23:42:26 -0500 Subject: vim: Improve function matching when functions contain ')' This fixes #3017 (VIM syntax highlight for regsubst fails) by converting puppetFunction from a simple keyword to a region. Signed-off-by: Todd Zullinger --- ext/vim/syntax/puppet.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/vim/syntax') diff --git a/ext/vim/syntax/puppet.vim b/ext/vim/syntax/puppet.vim index e86138a4c..80cd91c6c 100644 --- a/ext/vim/syntax/puppet.vim +++ b/ext/vim/syntax/puppet.vim @@ -51,8 +51,10 @@ syn match puppetParamDigits "[0-9]\+" " match 'template' in 'content => template("...")' syn match puppetParam "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName -syn keyword puppetFunction debug info notice warning err alert emerg crit -syn keyword puppetFunction sprintf template fail tagged include generate search file tag versioncmp fqdn_rand realize split defined regsubst sha1 inline_template contained +" statements +syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString +" 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\+}" -- cgit