671
671
" Use current line as input to ledger entry and replace with output. If there
672
672
" are errors, they are echoed instead.
673
673
function ! ledger#entry () abort
674
- let l: output = systemlist ( s: ledger_cmd (g: ledger_main , join ([' entry' , getline (' .' )])))
674
+ let l: output = split ( system ( s: ledger_cmd (g: ledger_main , join ([' entry' , getline (' .' )]))), ' \n ' )
675
675
" Filter out warnings
676
676
let l: output = filter (l: output , " v:val !~? '^Warning: '" )
677
677
" Errors may occur
@@ -695,7 +695,7 @@ endfunc
695
695
" Returns:
696
696
" Ledger's output as a String.
697
697
function ! ledger#report (file , args ) abort
698
- let l: output = systemlist ( s: ledger_cmd (a: file , a: args ))
698
+ let l: output = split ( system ( s: ledger_cmd (a: file , a: args )), ' \n ' )
699
699
if v: shell_error " If there are errors, show them in a quickfix/location list.
700
700
call s: quickfix_populate (l: output )
701
701
call s: quickfix_toggle (' Errors' , ' Unable to parse errors' )
@@ -742,7 +742,7 @@ function! ledger#register(file, args) abort
742
742
\ " --prepend-format='%(filename):%(beg_line) '" ,
743
743
\ a: args
744
744
\ ]))
745
- call s: quickfix_populate (systemlist ( l: cmd ))
745
+ call s: quickfix_populate (split ( system ( l: cmd), ' \n ' ))
746
746
call s: quickfix_toggle (' Register report' )
747
747
endf
748
748
@@ -761,7 +761,7 @@ function! ledger#reconcile(file, account, target_amount) abort
761
761
\ shellescape (a: account )
762
762
\ ]))
763
763
let l: file = expand (a: file ) " Needed for #show_balance() later
764
- call s: quickfix_populate (systemlist ( l: cmd ))
764
+ call s: quickfix_populate (split ( system ( l: cmd), ' \n ' ))
765
765
if s: quickfix_toggle (' Reconcile ' . a: account , ' Nothing to reconcile' )
766
766
let g: ledger_target_amount = a: target_amount
767
767
" Show updated account balance upon saving, as long as the quickfix window is open
@@ -805,7 +805,7 @@ function! ledger#show_balance(file, ...) abort
805
805
\ " --format='%(scrub(get_at(display_total, 0)))|%(scrub(get_at(display_total, 1)))|%(quantity(scrub(get_at(display_total, 1))))'" ,
806
806
\ (empty (g: ledger_default_commodity ) ? ' ' : ' -X ' . shellescape (g: ledger_default_commodity ))
807
807
\ ]))
808
- let l: output = systemlist ( l: cmd )
808
+ let l: output = split ( system ( l: cmd), ' \n ' )
809
809
" Errors may occur, for example, when the account has multiple commodities
810
810
" and g:ledger_default_commodity is empty.
811
811
if v: shell_error
0 commit comments