Closed HolyBlackCat closed 4 years ago
@HolyBlackCat do make sure you have "editor.foldingStrategy": "auto"
.
Which language are you using?
The folding markers are mostly meant to be used in a comment line (Emacs Folding Mode)
Here what I get in a JavaScript file:
Yes, "editor.foldingStrategy"
is set to "auto"
.
That's not a real language, just an example.
I get that behavior in a new unsaved file, without a language selected (status bar says Plain Text
). The same problem persists in C++ files.
I'm not sure why it's different in JavaScript files, but even in those the third line of this snippet folds incorrectly:
markers are mostly meant to be used in a comment line
That was my original intention, but since the extension seems to prevent builtin folding rules for .cpp
files from working (curly braces no longer fold), I needed to add {"begin":"\\{","end":"\\}"}
rule as well, which breaks folding in a way similar to what I described above.
@HolyBlackCat you are right there is an issue with c++ files.
@daiyam Could you please try to fix this bug? Your extension is the only one I found in the VS Code markplace which can manually specify C/C++ folding marker, which is great for me, but this bug is a bit annoying when it occurs... Thank you!
Hi @HolyBlackCat, it's very late but at last, it's fixed with 7ed6d0cc4e4d83b9a8a2a5b9ef43a9101a77bd29 (v0.4.0).
How to reproduce:
Config:
File:
Here's how the result looks like:
Now this might sound like an obscure thing to do, and it is, BUT...
Despite what the readme says, your extension seems to actually override/remove the builtin folding rules!
It means that in addition to custom rules I have to manually readd the basic curly brace folding:
"begin":"{","end":"}"
. I'm fine with that, but in the language I'm working with{}
on a single line is a common thing, which breaks your extension. :(