As you know, Delphi 2010 has built-in code formatting. However, formatting unfolds all folded code blocks. Any ideas how to fix it? This "feature" is particularly annoying for me and I was really astonished when I couldn't find any mention of this problem. What I've tried:
- Searching for alternative, e.g., GExperts have code formatter plugin, but it also unfolds code blocks.
- Tried to write a macro for GExperts: Ctrl+D(format code) -> various code folding/unfolding shortcuts, but couldn't manage to make it respect all folded/unfolded block structures.
- Write a CnWizards script, but could't find a code folding example.
I would be really grateful for any idea/hint.