branch: elpa/beancount commit 02fe03ee4487de7f83f587db65970b91ebd2d9d7 Author: ying <yingyuyao+yyym...@gmail.com> Commit: Martin Blais <bl...@furius.ca>
Fix font lock for accounts --- beancount-tests.el | 9 +++++++++ beancount.el | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/beancount-tests.el b/beancount-tests.el index 41d7576d96..be9201d5ae 100644 --- a/beancount-tests.el +++ b/beancount-tests.el @@ -129,6 +129,15 @@ Return a list of substrings each followed by its face." "1.00 USD" beancount-amount "Assets:Checking" beancount-account))) +(ert-deftest beancount/fontify-005 () + :tags '(font regress) + (beancount-test-font-lock " +2019-01-01 open Assets:TD:TDB900 TDB900 +" + '("2019-01-01" beancount-date + "open" beancount-directive + "Assets:TD:TDB900" beancount-account))) + (ert-deftest beancount/indent-001 () :tags '(indent regress) (with-temp-buffer diff --git a/beancount.el b/beancount.el index 6daf63b520..9ad9a5eb46 100644 --- a/beancount.el +++ b/beancount.el @@ -258,10 +258,10 @@ from the open directive for the relevant account." ;; Tags and links. (,(concat "\\#[" beancount-tag-chars "]*") . 'beancount-tag) (,(concat "\\^[" beancount-tag-chars "]*") . 'beancount-link) - ;; Number followed by currency not covered by previous rules. - (,(concat beancount-number-regexp "\\s-+" beancount-currency-regexp) . 'beancount-amount) ;; Accounts not covered by previous rules. (,beancount-account-regexp . 'beancount-account) + ;; Number followed by currency not covered by previous rules. + (,(concat beancount-number-regexp "\\s-+" beancount-currency-regexp) . 'beancount-amount) )) (defun beancount-tab-dwim (&optional arg)