vim-ledger icon indicating copy to clipboard operation
vim-ledger copied to clipboard

Account name omni completion does not include ending ")"

Open sorsasampo opened this issue 7 years ago • 4 comments

If the account name ends with ")", the auto completion does not include it.

Probably related to virtual postings syntax parsing?

sorsasampo avatar Apr 22 '18 03:04 sorsasampo

Confirmed, but I'm not sure how this should be fixed. The account name itself being completed does not have the ), nor should it since the same account names can be used for virtual or real postings. But of course when completing a virtual posting the most logical thing to do would be including it.

Perhaps the solution to this it actually to turn on some kind of parentheses completion function so that typing ( automatically adds the ending parenthesis, then filling in the account name can proceed as normal.

Thoughts anyone?

alerque avatar Jul 01 '19 14:07 alerque

@alerque: account names can contain parentheses, for example: Bank:Example (BE71 0961 2345 6769)

sorsasampo avatar Jul 07 '19 12:07 sorsasampo

Really. How does ledger parse virtual postings? Or is that unique to hledger? What about balance virtual postings (square brackets in hledger)? We've going to know exactly how both tools parse accounts to get this right.

alerque avatar Jul 07 '19 13:07 alerque

Account names can't start with ( since that would make it a virtual posting but otherwise they can contain brackets and they don't have to be matched.

Actually, that's not true. Account names can start with (. It's only a virtual posting if it starts with ( and ends with ).

Test:

2019-02-03 * Foo
    A(foo    10.00 EUR
    B

2019-02-03 * Foo
    (Afoo    10.00 EUR
    B
ledger -f d accounts
(Afoo
A(foo
B

tbm avatar Jul 07 '19 22:07 tbm