Skip to content

Commit 0c9deb0

Browse files
author
Lifepillar
committed
Improve :make command.
Ledger has a `source` command whose purpose is syntax checking. Use that in `makeprg` instead of an ad hoc query. Also, use `%:S` instead of `%` for shell escaping the file name.
1 parent 91790fc commit 0c9deb0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/ledger.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ CompilerSet errorformat+=%tarning:\ \"%f\"\\,\ line\ %l:\ %m
2424
" Skip all other lines:
2525
CompilerSet errorformat+=%-G%.%#
2626

27-
" unfortunately there is no 'check file' command,
28-
" so we will just use a query that returns no results. ever.
29-
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ reg\ not\ ''.*''\ \>\ /dev/null'
27+
" Check file syntax
28+
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ source\ %:S'
3029

0 commit comments

Comments
 (0)