Skip to content

Commit

Permalink
fix: vim folding using foldexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Dec 2, 2023
1 parent 4eba6bd commit ed84ce3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vim-ledger/ftplugin/ledger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ if has('folding')
endfunction

setlocal foldtext=LedgerFoldText()

" foldexpr to use blank lines to separate folds
setlocal foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
endif

" Commands for ledger file type:
Expand Down

0 comments on commit ed84ce3

Please sign in to comment.