This commit is contained in:
Adam Stankiewicz
2021-03-01 13:44:50 +01:00
parent 4c10562d2c
commit cc63193ce8
62 changed files with 1166 additions and 1072 deletions

View File

@@ -105,11 +105,16 @@ function! GetPuppetIndent(...)
let ind = indent(s:PrevNonMultilineString(pnum - 1))
endif
if pline =~ '\({\|\[\|(\|:\)\s*\(#.*\)\?$'
let l:bracketAtEndOfLinePattern = '\({\|\[\|(\|:\)\s*\(#.*\)\?$'
if pline =~ l:bracketAtEndOfLinePattern
let l:i = match(pline, l:bracketAtEndOfLinePattern)
let l:syntaxType = synIDattr(synID(pnum, l:i + 1, 0), 'name')
if l:syntaxType !~# '\(Comment\|String\)$'
let ind += &sw
endif
elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*'
let ind -= &sw
elseif pline =~ '^\s*include\s\+.*,$' && pline !~ '[=+]>'
elseif pline =~# '^\s*include\s\+.*,$' && pline !~ '[=+]>'
let ind += &sw
endif