diff options
author | Nathan Grigg | 2017-02-25 06:14:51 -0800 |
---|---|---|
committer | Nathan Grigg | 2017-02-25 06:14:51 -0800 |
commit | 548424b59ac5902a07d53a2c984baeb3983c28ca (patch) | |
tree | 4c4ebb60dd0cfdbcb47c4fd17c6ac957a52060a7 /syntax | |
parent | cbc17ade54ac18edc057fb52eb0120329cc24c4d (diff) | |
download | vim-beancount-548424b59ac5902a07d53a2c984baeb3983c28ca.tar.gz |
Update syntax to handle per-leg flags better.
Diffstat (limited to '')
-rw-r--r-- | syntax/beancount.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/syntax/beancount.vim b/syntax/beancount.vim index e75ebc1..5961c17 100644 --- a/syntax/beancount.vim +++ b/syntax/beancount.vim @@ -19,7 +19,10 @@ syn match beanCurrency "\v\w+" contained syn match beanAccount "\v[[:alnum:]]+:[-[:alnum:]:]+" contained syn match beanTag "\v#[-[:alnum:]]+" contained syn match beanLink "\v\^\S+" contained -syn match beanFlag "\v[*!&#?%PSTCURM]" contained +" We must require a space after the flag because you can have flags per +" transaction leg, and the letter-based flags might get confused with the +" start of an account name. +syn match beanFlag "\v[*!&#?%PSTCURM]\s\@=" contained " Most directives start with a date. syn match beanDate "^\v\d{4}[-/]\d{2}[-/]\d{2}" skipwhite @@ -54,7 +57,7 @@ syn region beanPad matchgroup=beanKeyword start="pad" end="$" contained syn region beanTxn matchgroup=beanKeyword start="\v\s+(txn|[*!&#?%PSTCURM])" skip="^\s" \ end="^" keepend contained fold \ contains=beanString,beanPost,beanComment,beanTag,beanLink,beanMeta -syn region beanPost start="^\v\C\s+(([!&#?%PSTCURM]\s+)?[A-Z])@=" end="$" +syn region beanPost start="^\v\C\s+(([*!&#?%PSTCURM]\s+)?[A-Z])@=" end="$" \ contains=beanFlag,beanAccount,beanAmount,beanComment,beanCost,beanPrice syn region beanMeta matchgroup=beanTag start="^\v\C\s+[a-z][-_a-zA-Z0-9]*:(\s|$)@=" end="$" |