Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Region Folding Via Indentation Only Works With Extra Newlines #62

Open
bam4564 opened this issue Oct 1, 2021 · 2 comments
Open

Comments

@bam4564
Copy link

bam4564 commented Oct 1, 2021

Hello! First of all just want to say thanks for this plugin, it's been extremely helpful.

I'm currently building out a beancount file, and I'm interested in organizing my sections via indentation using org mode style headers. I've noticed some strange behavior in vs code related to the interplay between syntax highlighting and indentation. I've included two images here which showcase the issue.

This first image shows the issue with syntax highlighting when there is there is a newline + a tab separating the two option directives:
Screen Shot 2021-10-01 at 11 44 26 AM

The second image shows that syntax highlighting works correctly when you add in one (or more) newlines between the option directives:
Screen Shot 2021-10-01 at 11 44 36 AM

Has anyone else experienced the same issue? Or could this possibly be due to some local misconfiguration on my part?

@bam4564 bam4564 changed the title Region Folding Via Indentation Only Works With Extra Newlines [bug] Region Folding Via Indentation Only Works With Extra Newlines Oct 1, 2021
@Lencerf
Copy link
Owner

Lencerf commented Oct 3, 2021

syntax highlighting works correctly when you add in one (or more) newlines between the option directives:

Yes. According to

<string>(?=(^\s*$|^\S))</string>

currently, an option directive must be followed by an empty newline, or a line starting with non-whitespace characters.

It is not hard to add syntax highlighting support to the code style in your first image, but beancount itself requires option directive lines start with no whitespaces. As I tested, bean-report complains syntax error, unexpected INDENT when there are spaces in front of option. Did you see similar errors?

@MatthewVasseur
Copy link

MatthewVasseur commented Aug 30, 2022

As I tested, bean-report complains syntax error, unexpected INDENT when there are spaces in front of option. Did you see similar errors?

(not the original poster but...) Agreed I see the same error: syntax error, unexpected INDENT

That being said, as far as I can tell, this syntax error is the only thing that is broken from beancount. It's still able to parse the file and generate reports.

I'm curious whether those people controlling folding via indents (e.g. #15) have ignored these bean-check errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants