bad indentation with compiler directives
Brought to you by:
anthonysteele
try to indent this :
function Get_MemoryInUse: Longint;
begin
{$IFDEF FPC}
Result:=Get_HeapStatus.CurrHeapUsed;
{$ELSE}
Result := GetHeapStatus.TotalAllocated;
{$ENDIF}
end;
is it not normal (i think) that
Result:=Get_HeapStatus.CurrHeapUsed;
is indented twice whereas
Result := GetHeapStatus.TotalAllocated;
gets indented just once.
They should be both indented either twice or once.
This is a small bug, but... a bug anyway
Logged In: YES
user_id=66544
In the FormatSettins|pre-processor page, if "enable
preprocessor parsing" is checked, only one of these code
paths will be parsed, and only this path will be formatted
and indented. The other need not even be valid Delphi code.
If the option is not checked, then both will be parsed and
both will be formatted. Which option best suits you depends
on the circumstances.
The checked option is to cover cases such as
procedure Foo;
begin
{$IFDEF BAR}
DoSomeThing();
end;
{$ELSE}
DoSomeThingElse();
end;
{$ENDIF}
Where parsing both code paths does not result in valid code.