From b36260d015c805d9b056d7e5984fcc8e20e45839 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 15 Apr 2014 01:26:34 +0200 Subject: Change puppet vendor, closes #24 --- indent/puppet.vim | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indent') 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 -" Last Change: 2009 Aug 19 +" Language: Puppet +" Maintainer: Todd Zullinger +" 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 -- cgit v1.2.3