I’m trying to figure out the difference between the commands “Code: Collapse Fold” and “Code: Collapse Fold Recursively”. Using key bindings, I have assigned different keyboard shortcuts to each of the two commands. Consider a test file in which folding is working properly:
0001
…0002
…0003
…0004
0005
…0006
…0007
…0008
(I am using periods here to indicate spaces, because when I try to use spaces and apply the “Preformatted text” command in the WYSIWYG editor on this forum page, it only works for the last four lines and not all of them.)
If the edit cursor is currently on the second line and I execute the command “Collapse Fold Recursively”, I expect the two more-indented lines immediately underneath it (3 and 4) to be folded up into the current line, and it does indeed result in:
0001
…0002
0005
…0006
…0007
…0008
The horizontal line extending all the way across the editor window of course indicates that there are hidden lines folded within it.
I wasn’t sure what to expect with “Collapse Fold”, but assumed it would be something different, since there are two separate commands. But when I execute “Collapse Fold”, the exact same behavior occurs.
Anyone know what the difference is – or is supposed to be – between these two commands? (I of course googled it first, but found nothing.)
0004 and 0005 were not collapsed because of non-recursive collapse (they might be collapsed by the user but the idea is that their state is unchanged). If it’s not working in the same way, I think it’s a bug and you should report it on the bug tracker
Thank you for your awesome reply. Also, I like that you included the braces, which I should have done, as well as the extra non-brace lines, such as the “code” immediately after 0002. So I improved my example text:
0001 {
…0002
…0003 <-- edit cursor here {
…0004
…0005 {
…0006
…0007 {
…0008
…}
…}
…}
}
I then tried both of the commands, but this time also paid attention to the results of what happens when all of the lines are subsequently expanded (which I had neglected to do earlier). It works exactly as you described it should.
As before, I resorted to using periods instead of spaces when posting indented text in this forum’s WYSIWYG editor. How are you able to preserve indentation when submitting your posts?