ledger/vim-ledger

transaction_post_state_set() confuses given line no. with cursor line

kanreki opened this issue · 2 comments

The ledger#transaction_post_state_set() function accepts a line number arg ("lnum") to specify which posting is to be touched. However, when assembling the modified text to replace the line it instead copies the original text from the cursor line (if the cursor happens to be on a posting line, or it just throws an error otherwise).

At line 129 the argument to getline() should be a:lnum instead of '.'.

By the way, the analogous ledger#transaction_state_set() works properly; but the comment there incorrectly states that it works on the cursor line.

Thanks for this report. Can you please go ahead and open a PR with this fix? You can even use the GitHub interface to edit the file and make the commit without cloning locally. I'd be happy to facilitate this but am busy with other stuff at the moment and might not get around to actually poking this in a timely way...

Closed by #130.