zokugun / vscode-explicit-folding

Customize your Folding for Visual Studio Code
MIT License
99 stars 14 forks source link

`"nested": false` doesn't work in "continuation"-based rules #21

Closed HolyBlackCat closed 4 years ago

HolyBlackCat commented 4 years ago

Now when #20 is fixed, my C++ folding rules are almost done, there's only one problem left.

I assume this was caused by the recent change of how "nested": false is handled.

Here's the config:

{
    "begin": "//",
    "continuation": "\\",
    "nested": false,
},
{
    "begin": "{",
    "end": "}",
},

And here's the text I test it on:

{  folding starts here
123
//  }  folding incorrectly ends here
456
}  folding should end here

Again, thanks for your great work! I'll send you a link to the C++ rules after I test them a bit.

daiyam commented 4 years ago

It's due to how the begin regex is constructed: \/\/.*\\$...