Skip to content

Commit 8d1785a

Browse files
author
Lifepillar
committed
Add <C-l> mapping to refresh the reconcile list.
1 parent 00e5395 commit 8d1785a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

autoload/ledger.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@ function! ledger#reconcile(account, target_amount, ...)
576576
execute "autocmd BufWritePost *.ldg,*.ledger call ledger#show_balance('" . a:account . "','" . l:file . "')"
577577
autocmd BufWipeout <buffer> call <sid>finish_reconciling()
578578
augroup END
579+
" Add refresh shortcut
580+
execute "nnoremap <silent> <buffer> <c-l> :<c-u>call ledger#reconcile('"
581+
\ . a:account . "'," . a:target_amount . ",'" . l:file . "')<cr>"
579582
" We need to pass the file path explicitly because at this point we are in
580583
" the quickfix window
581584
call ledger#show_balance(a:account, l:file)

doc/ledger.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ REPORTS *ledger-reports*
189189
may use |ledger#transaction_state_set()| to update a transaction's state.
190190
Every time you save your file, the balance and the difference from the
191191
target amount are updated at the bottom of the screen. The goal, of course,
192-
is to get such difference to zero. To finish reconciling an account, simply
193-
close the quickfix window.
192+
is to get such difference to zero. You may press `<C-l>` to refresh the
193+
Reconcile buffer. To finish reconciling an account, simply close the
194+
quickfix window.
194195

195196
There is a highlight group to customize the color of the difference from
196197
target:

0 commit comments

Comments
 (0)