Closed grgbrn closed 6 months ago
Nice catch.
There appears to be a bug in general when a format specifier expands into something shorter than the original specifier, and then there is another format specifier that follows closely. ledger-report-expand-format-specifiers
is incorrectly rescanning the string from the index where the last search ended not taking into account that the index may have changed if the replacement text is a different length.
When creating custom reports, using the
%(month)
expansion seems to prevent the%(account)
expansion from working.Adding a new report that uses both:
When executed:
so all of the expansions except
%(account)
work. If I remove%(month)
, then the%(account)
expansion works again. It's not related to the total number of expansions performed, hard-coding the binary and ledger file paths don't fix the problem.I updated to the latest version from melpa (20240414.2206) and am still seeing the problem.
I haven't looked into this any further, just wanted to file a bug while I was thinking about it. I'm not much of an elisp hacker but I'll see if I can find time to poke at it a bit later in the week