Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ftplugin/ledger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand All @@ -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)
Expand Down