From 7d0783466ea4779e7eb7e39267aba5c145e2ae0b Mon Sep 17 00:00:00 2001 From: sutehachi <56157299+sutehachi@users.noreply.github.com> Date: Tue, 18 Nov 2025 23:17:08 +0900 Subject: [PATCH] fix: if statment in func. collect_completion_data() --- ftplugin/ledger.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ftplugin/ledger.vim b/ftplugin/ledger.vim index b256296..4ea2303 100644 --- a/ftplugin/ledger.vim +++ b/ftplugin/ledger.vim @@ -229,17 +229,17 @@ endfunction function! s:collect_completion_data() let transactions = ledger#transactions() let cache = {'descriptions': [], 'tags': {}, 'accounts': {}, 'flat_accounts': []} - if b:ledger_bin + if exists('b:ledger_bin') let accounts = split(system(b:ledger_accounts_cmd), '\n') else let accounts = ledger#declared_accounts() endif let cache.flat_accounts = accounts - if b:ledger_bin + if exists('b:ledger_bin') let cache.descriptions = split(system(b:ledger_descriptions_cmd), '\n') endif for xact in transactions - if !b:ledger_bin + if !exists('b:ledger_bin') " collect descriptions if has_key(xact, 'description') && index(cache.descriptions, xact['description']) < 0 call add(cache.descriptions, xact['description']) @@ -249,7 +249,7 @@ function! s:collect_completion_data() let tagdicts = [t] " collect account names - if !b:ledger_bin + if !exists('b:ledger_bin') for posting in postings if has_key(posting, 'tags') call add(tagdicts, posting.tags)