Open zesterer opened 4 years ago
I like this idea. It also allows collapsing arbitrary lists, dicts and other structures that use braces. We already have cursor-goto-brace
which has logic to find the matching brace. What's missing is some support for hiding lines. One corner case is something with trailing text:
a {
b
c
} d
Now what happens to d when this is collapsed?
I presume the result would just be a { .. } d
?
Why not collapse every lines that has the same or lower indentation level, except the ones with 0 indentation ? That should work everywhere without configuration tweak.
Why not collapse every lines that has the same or lower indentation level, except the ones with 0 indentation ? That should work everywhere without configuration tweak.
I think this is a reasonable approach, yes.
Since Howl is a multi-language editor, it's obvious that properly parsing all languages to figure out where functions begin or end is... difficult. Instead, I offer an alternative suggestion: A way to minimise content enclosed within a given set of braces/brackets/parentheses. As an example,
Would minimise to
The character to perform the minimisation upon could be tweaked on a per-language basis.
I've not fully thought through how this might work with nesting, but I thought that starting a discussion about this would be the best thing to do.