codetools: auto indenter: fixed endless loop on pasting new section, bug #15030

git-svn-id: trunk@22864 -
This commit is contained in:
mattias 2009-11-30 08:31:00 +00:00
parent 35cb7923c6
commit 5e40787741

View File

@ -305,7 +305,7 @@ type
public
Stack: PBlock;
Capacity: integer;
Top: integer;
Top: integer; // -1 = empty, 0 = 1 item
TopType: TFABBlockType;
LastBlockClosed: TBlock;
LastBlockClosedAt: integer;
@ -1270,8 +1270,8 @@ function TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos(
procedure EndBigSection;
begin
while Stack.Top>=0 do
EndBlock;
if Stack.Top>=0 then
EndBlock(Stack.Top+1);
end;
procedure EndTopMostBlock(BlockTyp: TFABBlockType);
@ -1603,7 +1603,8 @@ begin
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: no context']);
{$ENDIF}
GetDefaultSrcIndent(Source,CleanPos,NewNestedComments,Indent);
Indent.Indent:=0;
Indent.IndentValid:=true;
exit(Indent.IndentValid);
end;