vim. display warning messages in quickfix window

To use this option you must set g:ledger_bin = "ledger --strict"
before the compiler plugin is loaded (your .vimrc for example).
This commit is contained in:
Johann Klähn 2010-08-14 12:24:46 +02:00
parent eda6cbd014
commit 0570c9c416

View file

@ -12,7 +12,7 @@ if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
if ! exists("g:ledger_bin") || ! executable(g:ledger_bin)
if ! exists("g:ledger_bin") || empty(g:ledger_bin) || ! executable(split(g:ledger_bin, '\s')[0])
if executable('ledger')
let g:ledger_bin = 'ledger'
else
@ -24,8 +24,9 @@ endif
" %-G throws away blank lines, everything else is assumed to be part of a
" multi-line error message.
CompilerSet errorformat=%-G,%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:%.%#,%ZError:\ %m,%C%.%#
CompilerSet errorformat+=%tarning:\ \"%f\"\\,\ line\ %l:\ %m
" unfortunately there is no 'check file' command,
" so we will just use a query that returns no results. ever.
exe 'CompilerSet makeprg='.g:ledger_bin.'\ -f\ %\ reg\ not\ ''.*''\ \>\ /dev/null'
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ reg\ not\ ''.*''\ \>\ /dev/null'