From 95d82fdb668b746ac100a8b7d2aca38038150707 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 29 Dec 2020 19:44:40 +0100 Subject: Update --- autoload/ledger.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'autoload/ledger.vim') diff --git a/autoload/ledger.vim b/autoload/ledger.vim index 76be457d..265aa666 100644 --- a/autoload/ledger.vim +++ b/autoload/ledger.vim @@ -444,6 +444,19 @@ function! ledger#align_commodity() abort endif endf +" Align the commodity on the entire buffer +function! ledger#align_commodity_buffer() abort + " Store the viewport position + let view = winsaveview() + + " Call ledger#align_commodity for every line + %call ledger#align_commodity() + + " Restore the viewport position + call winrestview(view) + unlet view +endf + " Align the amount under the cursor and append/prepend the default currency. function! ledger#align_amount_at_cursor() abort " Select and cut text: -- cgit v1.2.3