From f5db8a897f1eb01db88ee5579d7c5fff780afed0 Mon Sep 17 00:00:00 2001
From: Mark Lodato
Date: Tue, 23 Feb 2021 20:57:53 -0500
Subject: add commodity directive

---
 syntax/beancount.vim | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'syntax')

diff --git a/syntax/beancount.vim b/syntax/beancount.vim
index 3b3233c..03caf8c 100644
--- a/syntax/beancount.vim
+++ b/syntax/beancount.vim
@@ -26,7 +26,7 @@ syn match beanFlag "\v[*!&#?%PSTCURM]\s\@=" contained
 
 " Most directives start with a date.
 syn match beanDate "^\v\d{4}[-/]\d{2}[-/]\d{2}" skipwhite
-            \ nextgroup=beanOpen,beanTxn,beanClose,beanNote,beanBalance,beanEvent,beanPad,beanPrice
+            \ nextgroup=beanOpen,beanTxn,beanClose,beanCommodity,beanNote,beanBalance,beanEvent,beanPad,beanPrice
 " 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="$"
@@ -43,6 +43,8 @@ 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 beanCommodity matchgroup=beanKeyword start="commodity" end="$" keepend
+            \ contained contains=beanCurrency,beanComment
 syn region beanNote matchgroup=beanKeyword start="\vnote|document" end="$"
             \ keepend contains=beanAccount,beanString,beanComment contained
 syn region beanBalance matchgroup=beanKeyword start="balance" end="$" contained
-- 
cgit v1.2.3-2-gb3c3