Fixed #604: Remove indent condition for multi command folding

This commit is contained in:
Karl Yngve Lervåg 2016-12-14 21:09:38 +01:00
parent aa60cda284
commit cade17d13e
2 changed files with 5 additions and 10 deletions

View File

@ -443,20 +443,18 @@ function! s:cmd_multi(cmds) " {{{1
let l:fold = {}
let l:fold.re = {
\ 'start' : l:re,
\ 'start' : l:re . '.*(\{|\[)\s*(\%.*)?$',
\ 'end' : '^\s*}\s*$',
\ 'text' : l:re . '\{[^}]*\}'
\}
function! l:fold.level(line, lnum) dict
if a:line =~# self.re.start
\ && indent(a:lnum+1) > indent(a:lnum)
let self.indent = indent(a:lnum)
let self.opened = 1
return 'a1'
elseif has_key(self, 'indent')
elseif has_key(self, 'opened')
\ && a:line =~# self.re.end
\ && indent(a:lnum) == self.indent
unlet self.indent
unlet self.opened
return 's1'
endif
return ''

View File

@ -498,10 +498,7 @@ Options~
`single_opt` Useful for commands that open with a single long optional
argument, then a short "real" argument.
`multi` Useful for commands that start with a short regular argument
and continue with long optional and/or regular arguments. In
order for the folding to work as expected, this style depends
on the indentation to be correct. See the example below for
how to properly format the folded regions.
and continue with long optional and/or regular arguments.
The option combines the contents of |g:vimtex_fold_commands| and
|g:vimtex_fold_commands_default|. Entries in the former will have higher