Skip to content

Commit

Permalink
adapt compiler to hledger
Browse files Browse the repository at this point in the history
  • Loading branch information
Konfekt authored Nov 5, 2023
1 parent 8e735f8 commit 213ded3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/ledger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ if !b:is_hledger
CompilerSet errorformat+=%-G%.%#
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ ' . shellescape(expand(g:ledger_main))
else
exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
let &l:makeprg='hledger check --strict' . substitute(g:ledger_extra_options, ' ', '\\ ', 'g') . '-f %:S'
setlocal errorformat=%Ehledger:\ %trror:\ %f:%l:%c%.%#:,%-C\ \ \|\\s%#,%-C\%l\ \|%.%#,%-C\ \ \|\\s%#,%-C\ \ \|%p^,%+C%m,%-Z\\s%#
" Skip all other lines:
setlocal errorformat+=%-G%.%#
endif

0 comments on commit 213ded3

Please sign in to comment.