vscode-explicit-folding icon indicating copy to clipboard operation
vscode-explicit-folding copied to clipboard

Idea: A way to fold the *first* line, in similar to `"foldLastLine": true`.

Open HolyBlackCat opened this issue 2 years ago • 0 comments

Let's say I have this rule:

{
    "begin": "{",
    "end": "}",
}

If I apply it to:

void foo()
{
    //
}

It folds to:

void foo()
{ …

I can show or hide } using "foldLastLine", but there's currently no way to show/hide the {. I.e. no way to fold that to:

void foo() …

I think it would be nice to have something like "foldFirstLine", which moves the start of the fold one line up.

I'd then create two rules: one that matches a line that has nothing but { and whitespace ("foldFirstLine": true), and the fallback one that matches { elsewhere (false).

HolyBlackCat avatar Oct 18 '22 06:10 HolyBlackCat