Skip to content

Commit 1ecfd05

Browse files
committed
Merge pull request #26 from lifepillar/compilerset
Improve :make and errorformat.
2 parents b25181e + 0c9deb0 commit 1ecfd05

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

compiler/ledger.vim

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ if ! exists("g:ledger_bin") || empty(g:ledger_bin) || ! executable(split(g:ledge
1717
finish
1818
endif
1919

20-
" %-G throws away blank lines, everything else is assumed to be part of a
21-
" multi-line error message.
22-
CompilerSet errorformat=%-G,%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:%.%#,%ZError:\ %m,%C%.%#
20+
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
21+
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
22+
" Capture Ledger warnings:
2323
CompilerSet errorformat+=%tarning:\ \"%f\"\\,\ line\ %l:\ %m
24+
" Skip all other lines:
25+
CompilerSet errorformat+=%-G%.%#
2426

25-
" unfortunately there is no 'check file' command,
26-
" so we will just use a query that returns no results. ever.
27-
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'
2829

0 commit comments

Comments
 (0)