Fixed #604: Remove indent condition for multi command folding
This commit is contained in:
parent
aa60cda284
commit
cade17d13e
@ -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 ''
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user