diff options
author | Aaron Bull Schaefer | 2015-02-10 11:07:13 -0800 |
---|---|---|
committer | Aaron Bull Schaefer | 2015-02-10 11:07:13 -0800 |
commit | af8620f381ebc6b3620b06f2c2d977bdfb040df6 (patch) | |
tree | b23e58cf535d66cf47b0c5340ab42f33c5d5791e | |
parent | b463ee3dc9b7ae6d2ac20b508d0ee97f590a43bb (diff) | |
download | vim-beancount-af8620f381ebc6b3620b06f2c2d977bdfb040df6.tar.gz |
Properly highlight syntax containing hyphens and numbers
This PR fixes a few things:
1. Allow numbers within tags; tested to be valid and shown in the upstream documentation.
2. Padding directives have a date before them, so they should not be
anchored at the beginning of the line.
3. Hypens are allowed in meta-data attribute names; tested to be valid
and shown in the upstream documentation.
Diffstat (limited to '')
-rw-r--r-- | syntax/beancount.vim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/syntax/beancount.vim b/syntax/beancount.vim index 21aa4f1..e55d0f4 100644 --- a/syntax/beancount.vim +++ b/syntax/beancount.vim @@ -17,7 +17,7 @@ syn match beanAmount "\v[-+]?[[:digit:].,]+" nextgroup=beanCurrency contained syn match beanCurrency "\v\w+" contained " Account name: alphanumeric with at least one colon. syn match beanAccount "\v[[:alnum:]]+:[-[:alnum:]:]+" contained -syn match beanTag "\v#[-a-z]+" contained +syn match beanTag "\v#[-[:alnum:]]+" contained syn match beanLink "\v\^\S+" contained @@ -45,14 +45,14 @@ syn region beanBalance matchgroup=beanKeyword start="balance" end="$" contained syn region beanPrice matchgroup=beanKeyword start="price" end="$" contained \ contains=beanCurrency,beanAmount syn keyword beanKeyword pushtag poptag -syn region beanPad matchgroup=beanKeyword start="^pad" end="$" contained +syn region beanPad matchgroup=beanKeyword start="pad" end="$" contained \ contains=beanAccount,beanComment syn region beanTxn matchgroup=beanKeyword start="\v(txn)?\s+[*!]" skip="^\s" \ end="^" contains=beanString,beanPost,beanComment,beanTag,beanLink,beanMeta contained syn region beanPost start="^\v\C\s+[A-Z]@=" end="$" \ contains=beanAccount,beanAmount,beanComment,beanCost,beanPrice -syn region beanMeta matchgroup=beanTag start="^\v\C\s+[a-z]+:(\s|$)@=" end="$" +syn region beanMeta matchgroup=beanTag start="^\v\C\s+[-a-z]+:(\s|$)@=" end="$" syn region beanCost start="{" end="}" contains=beanAmount contained syn match beanPrice "\V@@\?" nextgroup=beanAmount contained |