Can I unfold code one level of indent at a time?

With this code:

func my_func(input):
    var value = 0
    match input:
        "A":
            value = 1
        "B":
            value = 2
    if value != 0:
        return true

If I fold the match line, and the if line, I see:

func my_func(input):
    var value = 0
    match input: (...)
    if value != 0: (...)

If I then fold my_func and unfold it again, I see all the code.

Is there a way to unfold my_func that preserves my previous folds?
OR unfold just one indent level at a time?

Thanks
Toby

There isn’t anything I can see built in.
You can create code regions; highlight the code/right click/create code region
But this seems a little chunky as it leaves a necessary title comment line.
(Edit: I tested and these too get unfolded so not a solution)

I would think the previous folds should persist and maybe you can do up a proposal to get at least the option of keeping folds.

2 Likes

OK, I’ve created a discussion