Skip to content

Commit 5b477eb

Browse files
committed
fix: Correctly handle set vs. unset ledger_bin setting logic
Closes #171 Closes #172 Closes #126
1 parent 74f4513 commit 5b477eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ftplugin/ledger.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,17 @@ endfunction
237237
function! s:collect_completion_data()
238238
let transactions = ledger#transactions()
239239
let cache = {'descriptions': [], 'tags': {}, 'accounts': {}, 'flat_accounts': []}
240-
if b:ledger_bin
240+
if b:ledger_bin !=# 0
241241
let accounts = split(system(b:ledger_accounts_cmd), '\n')
242242
else
243243
let accounts = ledger#declared_accounts()
244244
endif
245245
let cache.flat_accounts = accounts
246-
if b:ledger_bin
246+
if b:ledger_bin !=# 0
247247
let cache.descriptions = split(system(b:ledger_descriptions_cmd), '\n')
248248
endif
249249
for xact in transactions
250-
if !b:ledger_bin
250+
if b:ledger_bin ==# 0
251251
" collect descriptions
252252
if has_key(xact, 'description') && index(cache.descriptions, xact['description']) < 0
253253
call add(cache.descriptions, xact['description'])
@@ -257,7 +257,7 @@ function! s:collect_completion_data()
257257
let tagdicts = [t]
258258

259259
" collect account names
260-
if !b:ledger_bin
260+
if b:ledger_bin ==# 0
261261
for posting in postings
262262
if has_key(posting, 'tags')
263263
call add(tagdicts, posting.tags)

0 commit comments

Comments
 (0)