Open Falkgaard opened 3 years ago
I've found a hacky workaround that generally seems to give the result I'm looking for:
I insert a space between every };
so it becomes } ;
, and I appent a space and comment after every free-standing }
(i.e. } //
) that I want to to terminate and foldーwhich generally are functions.
You can use Plug tejasvi/vim-anyfold
meanwhile.
Is it possible to configure it so that the line with the terminating brace
}
and/or blank lines gets included in the fold?If I have:
I'd like it to fold into:
instead of:
EDIT 1:
It seems like putting the opening brace on its own line might accomplish what I want, I'll report back here after further testing.
EDIT 2:
Never mind that... same results regardless, but in some cases it seems to fold as I want, and in others it doesn't. Not quite sure yet what's causing the difference in behaviour for me.
But one issues seems to be when the brace ends with a semi-colon such as in the case of struct, class, union, enum, or brace initialization. But then again, in some cases it works... for example:
In one file I have these (white space annotated for clarity):
and I can fold all the using aliases into the comment, the function and BG properly, but not FG.
If I do try to fold them all it becomes:
So in the above case all but FG work as desired. Super weird.