From ed6f2154e964116e36de601702f1ac4010d74aaf Mon Sep 17 00:00:00 2001 From: Konstantin Mikhailov Date: Fri, 7 Oct 2016 17:23:25 +0000 Subject: Improve flag support Beancount allows to attach flags to transactions and even to the postings themselves. At the moment it supports 12 different flags. Full list can be found in beancount sources https://bitbucket.org/blais/beancount/src/tip/src/python/beancount/parser/lexer.l?fileviewer=file-view-default#lexer.l-199 The commit updates syntax highlighting and AlignCommodity function to respect all flags. --- autoload/beancount.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'autoload/beancount.vim') diff --git a/autoload/beancount.vim b/autoload/beancount.vim index 2096679..ecd423b 100644 --- a/autoload/beancount.vim +++ b/autoload/beancount.vim @@ -18,7 +18,7 @@ function! beancount#align_commodity(line1, line2) " This matches an account name followed by a space. There may be " some conflicts with non-transaction syntax that I don't know about. " It won't match a comment or any non-indented line. - let end_acc = matchend(s, '^\v([\-/[:digit:]]+\s+(balance|price))? +\S+[^:] ') + let end_acc = matchend(s, '^\v(([\-/[:digit:]]+\s+(balance|price))|\s+[!&#?%PSTCURM])?\s+\S+[^:] ') if end_acc < 0 | continue | endif " Where does commodity amount begin? let end_space = matchend(s, '^ *', end_acc) -- cgit v1.2.3-2-gb3c3