aboutsummaryrefslogtreecommitdiffstats
path: root/syntax
diff options
context:
space:
mode:
authorNathan Grigg2015-02-10 19:42:14 -0800
committerNathan Grigg2015-02-10 19:54:25 -0800
commitf70b4a3205f2d9ab3789f2f66e74328c8ad9ba7d (patch)
tree5528d60961257934a203460a8e0a5b8be08040cb /syntax
parent0367fefa737080d49eebbb20390d3b5c100941b1 (diff)
downloadvim-beancount-f70b4a3205f2d9ab3789f2f66e74328c8ad9ba7d.tar.gz
Don't allow directives to eat the end character.
Fixes #3.
Diffstat (limited to 'syntax')
-rw-r--r--syntax/beancount.vim25
1 files changed, 13 insertions, 12 deletions
diff --git a/syntax/beancount.vim b/syntax/beancount.vim
index 01d9710..e1685ad 100644
--- a/syntax/beancount.vim
+++ b/syntax/beancount.vim
@@ -27,29 +27,30 @@ syn match beanDate "^\v\d{4}-\d{2}-\d{2}" skipwhite
" Options and events have two string arguments. The first, we are matching as
" beanOptionTitle and the second as a regular string.
syn region beanOption matchgroup=beanKeyword start="^option" end="$"
- \ contains=beanOptionTitle,beanComment
+ \ keepend contains=beanOptionTitle,beanComment
syn region beanOption matchgroup=beanKeyword start="^plugin" end="$"
- \ contains=beanString,beanComment
+ \ keepend contains=beanString,beanComment
syn region beanEvent matchgroup=beanKeyword start="event" end="$" contained
- \ contains=beanOptionTitle,beanComment
+ \ keepend contains=beanOptionTitle,beanComment
syn region beanOptionTitle start='"' skip='\\"' end='"' contained
\ nextgroup=beanString skipwhite
-syn region beanOpen matchgroup=beanKeyword start="open" end="$" contained
- \ contains=beanAccount,beanCurrency,beanComment
-syn region beanClose matchgroup=beanKeyword start="close" end="$" contained
- \ contains=beanAccount,beanComment
+syn region beanOpen matchgroup=beanKeyword start="open" end="$" keepend
+ \ contained contains=beanAccount,beanCurrency,beanComment
+syn region beanClose matchgroup=beanKeyword start="close" end="$" keepend
+ \ contained contains=beanAccount,beanComment
syn region beanNote matchgroup=beanKeyword start="\vnote|document" end="$"
- \ contains=beanAccount,beanString,beanComment contained
+ \ keepend contains=beanAccount,beanString,beanComment contained
syn region beanBalance matchgroup=beanKeyword start="balance" end="$" contained
- \ contains=beanAccount,beanAmount,beanComment
+ \ keepend contains=beanAccount,beanAmount,beanComment
syn region beanPrice matchgroup=beanKeyword start="price" end="$" contained
- \ contains=beanCurrency,beanAmount
+ \ keepend contains=beanCurrency,beanAmount
syn keyword beanKeyword pushtag poptag
syn region beanPad matchgroup=beanKeyword start="pad" end="$" contained
- \ contains=beanAccount,beanComment
+ \ keepend contains=beanAccount,beanComment
syn region beanTxn matchgroup=beanKeyword start="\v(txn)?\s+[*!]" skip="^\s"
- \ end="^" contains=beanString,beanPost,beanComment,beanTag,beanLink,beanMeta contained fold
+ \ end="^" keepend contained fold
+ \ contains=beanString,beanPost,beanComment,beanTag,beanLink,beanMeta
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="$"