summaryrefslogtreecommitdiffstats
path: root/indent/puppet.vim
diff options
context:
space:
mode:
Diffstat (limited to 'indent/puppet.vim')
-rw-r--r--indent/puppet.vim15
1 files changed, 10 insertions, 5 deletions
diff --git a/indent/puppet.vim b/indent/puppet.vim
index 689e0687..56ee46d5 100644
--- a/indent/puppet.vim
+++ b/indent/puppet.vim
@@ -1,7 +1,7 @@
" Vim indent file
-" Language: Puppet
-" Maintainer: Todd Zullinger <tmz@pobox.com>
-" Last Change: 2009 Aug 19
+" Language: Puppet
+" Maintainer: Todd Zullinger <tmz@pobox.com>
+" Last Change: 2009 Aug 19
" vim: set sw=4 sts=4:
if exists("b:did_indent")
@@ -67,10 +67,15 @@ function! GetPuppetIndent()
let ind -= &sw
endif
- " Match } }, }; ] ]: )
- if line =~ '^\s*\(}\(,\|;\)\?$\|]:\?$\|)\)'
+ " Match } }, }; ] ]: ], ]; )
+ if line =~ '^\s*\(}\(,\|;\)\?$\|]:\|],\|}]\|];\?$\|)\)'
let ind = indent(s:OpenBrace(v:lnum))
endif
+ " Don't actually shift over for } else {
+ if line =~ '^\s*}\s*els\(e\|if\).*{\s*$'
+ let ind -= &sw
+ endif
+
return ind
endfunction