如何在 delphi 中保护代码片段免于自动格式化 CTRL+D

How to protect a fragment of code from auto-formatting CTRL+D in delphi

是否有任何指令可以防止代码片段被更改?

例如:

procedure Test;
{CODE_FORMATTER OFF}
const  a1 = 'a';  a2 = 'b';  a3 = 'c';    
                  b2 = 'd';  b3 = 'e';

{CODE_FORMATTER ON}
begin
end;    
   

Is there any directive to prevent fragment of code from being changed?

没有。