You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
// ...
<blank line>
// using aliases:
<tab> using U8 = uint8_t;
<tab> using U16 = uint16_t;
<tab> using U32 = uint32_t;
<tab> using U64 = uint64_t;
<tab> using I8 = int8_t;
<tab> using I16 = int16_t;
<tab> using I32 = int32_t;
<tab> using I64 = int64_t;
<tab> using F32 = float;
<tab> using F64 = double;
<blank line>
structFG { // foreground color
<tab> U8 code = 255;
};
<blank line>
[[nodiscard]] inlineautoto_string( FG const fg ) -> std::string {
<tab> returnstd::string("38;5;") + std::to_string(fg.code);
}
<blank line>
structBG { // background color
<tab> U8 code = 238;
};
<blank line>
// ...
and I can fold all the using aliases into the comment, the function and BG properly, but not FG.
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.
tejasvi
added a commit
to tejasvi/vim-anyfold
that referenced
this issue
Jan 20, 2022
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.
The text was updated successfully, but these errors were encountered: