function! s:sectionLevel(lnum)
let l = a:lnum
while l > 0
- let lineCurr = getline(l)
- let depth = match(lineCurr, '\(^ *#\+\)\@<=\( .*$\)\@=')
- if depth > 0
- return depth
+ let l:lineCurr = getline(l)
+ let l:depth = match(l:lineCurr, '\(^#\+\)\@<=\( .*$\)\@=')
+ if l:depth > 0
+ return l:depth
endif
let l = l-1
endwhile
endfunction
function! TctFold()
- let lineCurr = getline(v:lnum)
+ let l:lineCurr = getline(v:lnum)
" Fold wrt. section level
- let depth = match(lineCurr, '\(^ *#\+\)\@<=\( .*$\)\@=')
- if depth > 0
- return ">" . depth
+ let l:depth = match(l:lineCurr, '\(^#\+\)\@<=\( .*$\)\@=')
+ if l:depth > 0
+ return ">" . l:depth
endif
" Fold wrt. indent level
if s:vim_tct_folding_indent == 1
- let spacesCurr = matchend(lineCurr,"^ *")
+ let spacesCurr = matchend(l:lineCurr,"^ *")
return s:sectionLevel(v:lnum) + spacesCurr
endif