Skip to content

Commit 5692a81

Browse files
committed
don't add indent level for include as a resource parameter (closes: rodjek#99)
The current code was designed to fit the case where one would write this: include class1, class2, class3 But it creates a problem with resources that might have a parameter named include. For example in the following situation, we would have an indent added even though there's no reason for it: someresource { 'name': include => 'some value',<press C-R here> It does fit the current regex because it both has include at the beginning of the line only preceded by spaces and the line is ended with a comma. In order to avoid this extraneous indentation, let's just exclude cases that contain either "=>" or "+>" on the line: we'll interpret this as representing a parameter being set for a resource.
1 parent 5680f0d commit 5692a81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

indent/puppet.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function! GetPuppetIndent(...)
6767
let ind += &sw
6868
elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*'
6969
let ind -= &sw
70-
elseif pline =~ '^\s*include\s\+.*,$'
70+
elseif pline =~ '^\s*include\s\+.*,$' && pline !~ '[=+]>'
7171
let ind += &sw
7272
endif
7373

0 commit comments

Comments
 (0)