diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-05-20 20:24:48 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-05-20 20:24:48 +0200 |
commit | 685aeaaeb1b3fb6e3a9b4304799663f62bc8e1b3 (patch) | |
tree | 8fc5312e37d21b97d1b6e668ad4a7b81e6ff7314 /compiler/ledger.vim | |
parent | a9cc6fd2188ddc37257c834b6f5a5fa86d0eebd5 (diff) | |
download | vim-polyglot-685aeaaeb1b3fb6e3a9b4304799663f62bc8e1b3.tar.gz vim-polyglot-685aeaaeb1b3fb6e3a9b4304799663f62bc8e1b3.zip |
Add ledger support, closes #488v4.4.1
Diffstat (limited to 'compiler/ledger.vim')
-rw-r--r-- | compiler/ledger.vim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/compiler/ledger.vim b/compiler/ledger.vim new file mode 100644 index 00000000..7a9bc305 --- /dev/null +++ b/compiler/ledger.vim @@ -0,0 +1,32 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ledger') == -1 + +" Vim Compiler File +" Compiler: ledger +" by Johann Klähn; Use according to the terms of the GPL>=2. +" vim:ts=2:sw=2:sts=2:foldmethod=marker + +scriptencoding utf-8 + +if exists('current_compiler') || !exists('g:ledger_bin') + finish +endif + +let current_compiler = g:ledger_bin + +if exists(':CompilerSet') != 2 + command -nargs=* CompilerSet setlocal <args> +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%.%# + " Capture Ledger warnings: + 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\ %' +else + exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)' +endif + +endif |