Delphi auto format format violates anonymous procedures

Yesterday I discovered the Format Source function in Delphi, and it saves a lot of time.

However, I found that it distorts the layout of anonymous procedures. Is there a way that can improve this result?

For example, if I have the following code:

procedure TServerThread.cbUpdateStreamProgBar(Precentage: Integer);
begin
  Synchronize(
    procedure
    begin
      FrmMain.StreamProgressBar.StepBy(Precentage);
    end);
end;

After automatically formatting the source code, it is minimized as follows:

procedure TServerThread.cbUpdateStreamProgBar(Precentage: Integer);
begin
  Synchronize( procedure begin FrmMain.StreamProgressBar.StepBy
    (Precentage); end);
end;

How can i avoid this?

+5
source share
1 answer

You need to upgrade to the new version of Delphi, as indicated in the comments. XE2's automatic formatting source is suitable for anonymous methods.

IDE Gexperts. , , .

. Delphi code formatter.


, , . , . , ctrl + D.

+2

All Articles