From 213ded390f515aa157b170848f0f17249413aea5 Mon Sep 17 00:00:00 2001 From: Enno Date: Sun, 5 Nov 2023 06:42:56 +0100 Subject: [PATCH] adapt compiler to hledger --- compiler/ledger.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/ledger.vim b/compiler/ledger.vim index 495fba2..174f617 100644 --- a/compiler/ledger.vim +++ b/compiler/ledger.vim @@ -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