summaryrefslogtreecommitdiffstats
path: root/compiler/ledger.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-05-28 11:09:19 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-05-28 11:09:19 +0200
commit224a6348f99167c9d72b5922686d388ae872ff7e (patch)
tree328383c5ca7e8fa59a47ba5bb0709676c3964677 /compiler/ledger.vim
parent00c3f0294575a91524c3f3b6cba37839716b48a2 (diff)
downloadvim-polyglot-224a6348f99167c9d72b5922686d388ae872ff7e.tar.gz
vim-polyglot-224a6348f99167c9d72b5922686d388ae872ff7e.zip
Update
Diffstat (limited to 'compiler/ledger.vim')
-rw-r--r--compiler/ledger.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/ledger.vim b/compiler/ledger.vim
index 7a9bc305..8d441af9 100644
--- a/compiler/ledger.vim
+++ b/compiler/ledger.vim
@@ -17,6 +17,10 @@ if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
endif
+if !exists('g:ledger_main')
+ let g:ledger_main = '%'
+endif
+
if !g:ledger_is_hledger
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
@@ -24,9 +28,9 @@ if !g:ledger_is_hledger
CompilerSet errorformat+=%tarning:\ \"%f\"\\,\ line\ %l:\ %m
" Skip all other lines:
CompilerSet errorformat+=%-G%.%#
- exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ %'
+ exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . shellescape(expand(g:ledger_main)) . '\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ ' . shellescape(expand(g:ledger_main))
else
- exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
+ exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . shellescape(expand(g:ledger_main)) . '\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
endif
endif