beancount / beancount-mode

Emacs major-mode to work with Beancount ledger files
GNU General Public License v3.0
113 stars 32 forks source link

Fix a small font lock bug #16

Closed yyymeow closed 3 years ago

yyymeow commented 3 years ago

I came across this super peculiar edge case in syntax highlighting

When an account is opened, if the account a) ends with a number, and b) is followed by a currency constraint The number & currency part will be misinterpreted as an amount, which will then cause the account part to be misidentified.

The fix seems to be simple... This PR reverses the order of amount & account in the font lock keywords. I couldn't think of an edge case that this'll break... (since account is always space-less and self-contained) But then.. I'm new to beancount, so plz take that with a grain of salt.