Suppose we have something like this:
{ // 1
A();
{ // 1.1
B();
{ // 1.1.1
{ // 1.1.1.1
D();
}
X();
{ // 1.1.1.2
E();
}
}
C();
{ // 1.1.2
F();
}
}
}
And we'd like to collapse block 1.1.1
along with all the blocks in it to get:
{ // 1
A();
{ // 1.1
B();
{...} // 1.1.1
// {...} 1.1.1.1 also collapsed in 1.1.1
// X();
// {...} 1.1.1.2 also collapsed in 1.1.2
C();
{ // 1.1.2
F();
}
}
}
Is there a way to do it quickly (esp. in case of multiple layers of sub-blocks)?
I know of CTRL+M+L, which I tend to use quite often, and would love to learn more.
Have a good day.
The feauture I was looking for was in Edit.Outlining.Collapse All in:
It seems to not have a shortcut assigned by default, so
I went to Tools.Options...
Then in the left panel select Environment > Keyboard
Find Edit.CollapseAllincurrentblock on the right
In editbox "Press shortcut keys", pressed CTRL+M, CTRL+B in order
In "Use new shortcut in:", I used Global
Click Assign
Done.
Now, if you're in a block, clicking CTRL+M followed by CTRL+B should collapse all blocks in current block. The only missing part is that the current block itself remains expanded, but that can be fixed with CTRL+M, CTRL+S (collapse current region, which collapses the current block, but not inner blocks).