Skip to content

Commit 72abca6

Browse files
committed
Fix bug where completion includes following accounts.
Suppose we have the ledger file below: 2015/07/16 payee act1:liabilities:card1 $15 expenses:misc 2015/07/16 payee2 act2:liabilities:card2 $15 expenses:misc When completing "a:li:card1", the completion function will return both "act1:liabilities:card1" and "act2". The account "act2" is included because it is using the exact value from the previous "act1:liabilities:card1" match.
1 parent 97fa935 commit 72abca6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/ledger.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ function! ledger#find_in_tree(tree, levels)
297297
let currentlvl = a:levels[0]
298298
let nextlvls = a:levels[1:]
299299
let branches = ledger#filter_items(keys(a:tree), currentlvl)
300-
let exact = empty(nextlvls)
301300
for branch in branches
301+
let exact = empty(nextlvls)
302302
call add(results, [branch, exact])
303303
if ! empty(nextlvls)
304304
for [result, exact] in ledger#find_in_tree(a:tree[branch], nextlvls)

0 commit comments

Comments
 (0)