From 0c6d89cbe679f5ac7fa5db56e816c34f2d2f9ff6 Mon Sep 17 00:00:00 2001 From: Zahan Malkani Date: Sat, 5 Jan 2019 11:20:52 -0800 Subject: [PATCH 1/2] Allow directives to be indented beancount does fine with indented `pushtag` and `option` directives, but this extensions syntax didn't recognize it why indent? for folding, as outlined in https://github.com/Lencerf/vscode-beancount/issues/5 I prefer indenting over the `;#region` syntax since it's more editor independant test plan: I used it locally with my own file and syntax highlighting looked fine with the indentation --- syntaxes/beancount.tmLanguage | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syntaxes/beancount.tmLanguage b/syntaxes/beancount.tmLanguage index abe97fd..79c9369 100644 --- a/syntaxes/beancount.tmLanguage +++ b/syntaxes/beancount.tmLanguage @@ -20,7 +20,7 @@ begin - ^(poptag|pushtag)\s+(#)([A-Za-z0-9\-_/.]+) + ^\s*(poptag|pushtag)\s+(#)([A-Za-z0-9\-_/.]+) beginCaptures 1 @@ -59,7 +59,7 @@ begin - ^(include)\s+(\".*\") + ^\s*(include)\s+(\".*\") beginCaptures 1 @@ -93,7 +93,7 @@ begin - ^(option)\s+(\".*\")\s+(\".*\") + ^\s*(option)\s+(\".*\")\s+(\".*\") beginCaptures 1 @@ -132,7 +132,7 @@ begin - ^(plugin)\s+(\"(.*)\")\s+(\".*\") + ^\s*(plugin)\s+(\"(.*)\")\s+(\".*\") beginCaptures 1 From e48d409a04e6589a8fe330b6f15f0e1d8295b0e1 Mon Sep 17 00:00:00 2001 From: Zahan Malkani Date: Sat, 5 Jan 2019 11:27:08 -0800 Subject: [PATCH 2/2] Add documentation for code folding to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8ac702b..c2905b1 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Simple [Beancount](http://furius.ca/beancount/) support for VSCode 4. Auto balance checking after saving files 5. Hovers with account balances. 6. Code snippets ([@vlamacko](https://github.com/Lencerf/vscode-beancount/pull/7)) +7. Region folding - use indentation (#5), or special comments (#11) ## Extension Settings