How do I avoid expanding folded regions when I invoke the code formatter?

后端 未结 2 1066
清酒与你
清酒与你 2021-01-21 23:05

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

2条回答
  •  长情又很酷
    2021-01-21 23:32

    One way to work around it is to not format the entire file at once, but to select a portion, and format that.

    As long as you don't select a region, the expand-state of all regions remains untouched.

    Formatting an entire file at once is usually not really a good idea anyway, because the formatter doesn't "understand" what it's doing. I always inspect all changes that it makes, and that's easier when there are no changes outside of the area that's visible.

提交回复
热议问题