summaryrefslogtreecommitdiff
path: root/contrib/vim/compiler
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2010-08-14 12:24:46 +0200
committerJohann Klähn <kljohann@gmail.com>2010-08-14 12:24:46 +0200
commit0570c9c416a3cdad9c312a392300413d979696ac (patch)
treefa5278cf2c285c8bad0f03acad70da528d1f8d0c /contrib/vim/compiler
parenteda6cbd0146d371653feec70e0eb3ee4e4c56379 (diff)
downloadfork-ledger-0570c9c416a3cdad9c312a392300413d979696ac.tar.gz
fork-ledger-0570c9c416a3cdad9c312a392300413d979696ac.tar.bz2
fork-ledger-0570c9c416a3cdad9c312a392300413d979696ac.zip
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).
Diffstat (limited to 'contrib/vim/compiler')
-rw-r--r--contrib/vim/compiler/ledger.vim5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/vim/compiler/ledger.vim b/contrib/vim/compiler/ledger.vim
index 33b019cb..b6bb7fb4 100644
--- a/contrib/vim/compiler/ledger.vim
+++ b/contrib/vim/compiler/ledger.vim
@@ -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'