Skip to content

Commit

Permalink
Reset foldlevel after generating folds
Browse files Browse the repository at this point in the history
  • Loading branch information
nickspoons committed Jul 21, 2020
1 parent a47f4ed commit a40d527
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autoload/OmniSharp/actions/fold.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ endfunction

function! s:CreateFolds(bufnr, codeElements) abort
if a:bufnr != bufnr('%') | return | endif
let ranges = reverse(s:FindBlocks(a:codeElements))
if len(ranges) == 0
return
endif
setlocal foldmethod=manual
normal! zE
for range in reverse(s:FindBlocks(a:codeElements))
for range in ranges
execute printf('%d,%dfold', range[0], range[1])
endfor
" All folds are currently closed - reset to current foldlevel
let &l:foldlevel = &foldlevel
endfunction

function! s:FindBlocks(codeElements) abort
Expand Down

0 comments on commit a40d527

Please sign in to comment.