IDE: enabled codetools auto indent by default

git-svn-id: trunk@22403 -
This commit is contained in:
mattias 2009-11-03 13:10:56 +00:00
parent 38a3e64177
commit 2cd414bcbd
3 changed files with 60 additions and 5 deletions

View File

@ -1067,7 +1067,9 @@ function TFullyAutomaticBeautifier.FindPolicyInExamples(StartCode: TCodeBuffer;
begin begin
Policies:=nil; Policies:=nil;
if Code=nil then exit(true); if Code=nil then exit(true);
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.FindPolicyInExamples ',Code.Filename]); DebugLn(['TFullyAutomaticBeautifier.FindPolicyInExamples ',Code.Filename]);
{$ENDIF}
// search Policies for code // search Policies for code
AVLNode:=FCodePolicies.FindKey(Code,@CompareCodeWithFABPolicy); AVLNode:=FCodePolicies.FindKey(Code,@CompareCodeWithFABPolicy);
if AVLNode=nil then begin if AVLNode=nil then begin
@ -1211,7 +1213,9 @@ var
r: PChar; r: PChar;
p: LongInt; p: LongInt;
begin begin
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos START']); DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos START']);
{$ENDIF}
Result:=Stack.Top; Result:=Stack.Top;
if Result<0 then exit; if Result<0 then exit;
if (CleanPos<1) or (CleanPos>length(Source)) if (CleanPos<1) or (CleanPos>length(Source))
@ -1219,9 +1223,13 @@ begin
exit; exit;
p:=CleanPos; p:=CleanPos;
ReadRawNextPascalAtom(Source,p,AtomStart,NestedComments); ReadRawNextPascalAtom(Source,p,AtomStart,NestedComments);
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos ',AtomStart<>CleanPos,' CleanPos=',dbgstr(copy(Source,CleanPos,10)),' AtomStart=',dbgstr(copy(Source,AtomStart,10))]); DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos ',AtomStart<>CleanPos,' CleanPos=',dbgstr(copy(Source,CleanPos,10)),' AtomStart=',dbgstr(copy(Source,AtomStart,10))]);
{$ENDIF}
if AtomStart<>CleanPos then exit; if AtomStart<>CleanPos then exit;
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos Atom=',copy(Source,AtomStart,p-AtomStart)]); DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos Atom=',copy(Source,AtomStart,p-AtomStart)]);
{$ENDIF}
r:=@Source[AtomStart]; r:=@Source[AtomStart];
case UpChars[r^] of case UpChars[r^] of
'B': 'B':
@ -1355,8 +1363,10 @@ begin
if CompareIdentifiers('VAR',r)=0 then if CompareIdentifiers('VAR',r)=0 then
EndIdentifierSectionAndProc; EndIdentifierSectionAndProc;
end; end;
{$IFDEF VerboseIndenter}
if Stack.Top<>Result then if Stack.Top<>Result then
DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos block close: Stack.Top=',Stack.Top,' Result=',Result]); DebugLn(['TFullyAutomaticBeautifier.FindStackPosForBlockCloseAtPos block close: Stack.Top=',Stack.Top,' Result=',Result]);
{$ENDIF}
end; end;
procedure TFullyAutomaticBeautifier.WriteDebugReport(Msg: string; procedure TFullyAutomaticBeautifier.WriteDebugReport(Msg: string;
@ -1410,7 +1420,9 @@ var
BlockIndent:=Policies.GetSmallestIndent(Block.Typ); BlockIndent:=Policies.GetSmallestIndent(Block.Typ);
if (BlockIndent<0) then exit; if (BlockIndent<0) then exit;
// policy found // policy found
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent policy found: Block.Typ=',FABBlockTypeNames[Block.Typ],' BlockIndent=',BlockIndent]); DebugLn(['TFullyAutomaticBeautifier.GetIndent policy found: Block.Typ=',FABBlockTypeNames[Block.Typ],' BlockIndent=',BlockIndent]);
{$ENDIF}
Indent.Indent:=GetLineIndentWithTabs(Source,Block.StartPos,DefaultTabWidth) Indent.Indent:=GetLineIndentWithTabs(Source,Block.StartPos,DefaultTabWidth)
+BlockIndent; +BlockIndent;
Indent.IndentValid:=true; Indent.IndentValid:=true;
@ -1448,13 +1460,19 @@ begin
Policies.Code.Source:=Source; Policies.Code.Source:=Source;
{$ENDIF} {$ENDIF}
// parse source in front // parse source in front
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent "',dbgstr(copy(Source,CleanPos-10,10)),'|',dbgstr(copy(Source,CleanPos,10)),'"']); DebugLn(['TFullyAutomaticBeautifier.GetIndent "',dbgstr(copy(Source,CleanPos-10,10)),'|',dbgstr(copy(Source,CleanPos,10)),'"']);
{$ENDIF}
ParseSource(Source,1,CleanPos,NewNestedComments,Stack,Policies, ParseSource(Source,1,CleanPos,NewNestedComments,Stack,Policies,
LastAtomStart,LastAtomEnd); LastAtomStart,LastAtomEnd);
{$IFDEF VerboseIndenter}
WriteDebugReport('After parsing code in front:',Stack); WriteDebugReport('After parsing code in front:',Stack);
{$ENDIF}
if (LastAtomStart>0) and (CleanPos>LastAtomStart) then begin if (LastAtomStart>0) and (CleanPos>LastAtomStart) then begin
// in comment or atom // in comment or atom
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: position in middle of atom, e.g. comment']); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: position in middle of atom, e.g. comment']);
{$ENDIF}
GetDefaultSrcIndent(Source,CleanPos,NewNestedComments,Indent); GetDefaultSrcIndent(Source,CleanPos,NewNestedComments,Indent);
exit(Indent.IndentValid); exit(Indent.IndentValid);
end; end;
@ -1467,7 +1485,9 @@ begin
if (StackIndex<0) then begin if (StackIndex<0) then begin
// no context // no context
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: no context']); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: no context']);
{$ENDIF}
GetDefaultSrcIndent(Source,CleanPos,NewNestedComments,Indent); GetDefaultSrcIndent(Source,CleanPos,NewNestedComments,Indent);
exit(Indent.IndentValid); exit(Indent.IndentValid);
end; end;
@ -1476,13 +1496,17 @@ begin
if StackIndex>0 then if StackIndex>0 then
ParentBlock:=Stack.Stack[StackIndex-1]; ParentBlock:=Stack.Stack[StackIndex-1];
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: context=',FABBlockTypeNames[ParentBlock.Typ],'/',FABBlockTypeNames[Block.Typ],' indent=',GetLineIndentWithTabs(Source,Block.StartPos,DefaultTabWidth)]); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: context=',FABBlockTypeNames[ParentBlock.Typ],'/',FABBlockTypeNames[Block.Typ],' indent=',GetLineIndentWithTabs(Source,Block.StartPos,DefaultTabWidth)]);
{$ENDIF}
if CheckPolicies(Policies,Result) then exit; if CheckPolicies(Policies,Result) then exit;
if ContextLearn then begin if ContextLearn then begin
// parse source behind // parse source behind
ParseSource(Source,CleanPos,length(Source)+1,NewNestedComments,Stack,Policies); ParseSource(Source,CleanPos,length(Source)+1,NewNestedComments,Stack,Policies);
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed source behind']); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed source behind']);
{$ENDIF}
if CheckPolicies(Policies,Result) then exit; if CheckPolicies(Policies,Result) then exit;
end; end;
finally finally
@ -1494,7 +1518,9 @@ begin
// parse examples // parse examples
Policies:=FindPolicyInExamples(nil,ParentBlock.Typ,Block.Typ); Policies:=FindPolicyInExamples(nil,ParentBlock.Typ,Block.Typ);
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed examples']); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed examples']);
{$ENDIF}
if CheckPolicies(Policies,Result) then exit; if CheckPolicies(Policies,Result) then exit;
//GetDefaultIndentPolicy(ParentBlock.Typ,Block.Typ); //GetDefaultIndentPolicy(ParentBlock.Typ,Block.Typ);
@ -1517,7 +1543,9 @@ var
BlockIndent:=Policies.GetSmallestIndent(Item^.Block.Typ); BlockIndent:=Policies.GetSmallestIndent(Item^.Block.Typ);
if (BlockIndent<0) then exit; if (BlockIndent<0) then exit;
// policy found // policy found
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent policy found: Block.Typ=',FABBlockTypeNames[Item^.Block.Typ],' BlockIndent=',BlockIndent]); DebugLn(['TFullyAutomaticBeautifier.GetIndent policy found: Block.Typ=',FABBlockTypeNames[Item^.Block.Typ],' BlockIndent=',BlockIndent]);
{$ENDIF}
Item^.Indent.Indent:=GetLineIndentWithTabs(Source,Item^.Block.StartPos,DefaultTabWidth) Item^.Indent.Indent:=GetLineIndentWithTabs(Source,Item^.Block.StartPos,DefaultTabWidth)
+BlockIndent; +BlockIndent;
Item^.Indent.IndentValid:=true; Item^.Indent.IndentValid:=true;
@ -1566,7 +1594,9 @@ begin
Item:=@Positions.Items[ItemIndex]; Item:=@Positions.Items[ItemIndex];
if ItemIndex=0 then begin if ItemIndex=0 then begin
// parse source in front // parse source in front
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent Index=',ItemIndex,' "',dbgstr(copy(Source,Item^.CleanPos-10,10)),'|',dbgstr(copy(Source,Item^.CleanPos,10)),'"']); DebugLn(['TFullyAutomaticBeautifier.GetIndent Index=',ItemIndex,' "',dbgstr(copy(Source,Item^.CleanPos-10,10)),'|',dbgstr(copy(Source,Item^.CleanPos,10)),'"']);
{$ENDIF}
ParseSource(Source,1,Item^.CleanPos,NewNestedComments,Stack,Policies, ParseSource(Source,1,Item^.CleanPos,NewNestedComments,Stack,Policies,
LastAtomStart,LastAtomEnd); LastAtomStart,LastAtomEnd);
end else begin end else begin
@ -1575,10 +1605,14 @@ begin
Item^.CleanPos,NewNestedComments,Stack,nil, Item^.CleanPos,NewNestedComments,Stack,nil,
LastAtomStart,LastAtomEnd); LastAtomStart,LastAtomEnd);
end; end;
{$IFDEF VerboseIndenter}
WriteDebugReport('After parsing code: ',Stack); WriteDebugReport('After parsing code: ',Stack);
{$ENDIF}
if (LastAtomStart>0) and (Item^.CleanPos>LastAtomStart) then begin if (LastAtomStart>0) and (Item^.CleanPos>LastAtomStart) then begin
// in comment or atom // in comment or atom
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent Index=',ItemIndex,' parsed code in front: position in middle of atom, e.g. comment']); DebugLn(['TFullyAutomaticBeautifier.GetIndent Index=',ItemIndex,' parsed code in front: position in middle of atom, e.g. comment']);
{$ENDIF}
GetDefaultSrcIndent(Source,Item^.CleanPos,NewNestedComments,Item^.Indent); GetDefaultSrcIndent(Source,Item^.CleanPos,NewNestedComments,Item^.Indent);
if Item^.Indent.IndentValid then begin if Item^.Indent.IndentValid then begin
dec(Needed); dec(Needed);
@ -1593,7 +1627,9 @@ begin
NewNestedComments,Stack); NewNestedComments,Stack);
if (StackIndex<0) then begin if (StackIndex<0) then begin
// no context // no context
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent Index=',ItemIndex,' parsed code in front: no context']); DebugLn(['TFullyAutomaticBeautifier.GetIndent Index=',ItemIndex,' parsed code in front: no context']);
{$ENDIF}
GetDefaultSrcIndent(Source,Item^.CleanPos,NewNestedComments,Item^.Indent); GetDefaultSrcIndent(Source,Item^.CleanPos,NewNestedComments,Item^.Indent);
if Item^.Indent.IndentValid then begin if Item^.Indent.IndentValid then begin
dec(Needed); dec(Needed);
@ -1611,7 +1647,9 @@ begin
if StackIndex>0 then if StackIndex>0 then
Item^.ParentBlock:=Stack.Stack[StackIndex-1]; Item^.ParentBlock:=Stack.Stack[StackIndex-1];
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: context=',FABBlockTypeNames[Item^.ParentBlock.Typ],'/',FABBlockTypeNames[Item^.Block.Typ],' indent=',GetLineIndentWithTabs(Source,Item^.Block.StartPos,DefaultTabWidth)]); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed code in front: context=',FABBlockTypeNames[Item^.ParentBlock.Typ],'/',FABBlockTypeNames[Item^.Block.Typ],' indent=',GetLineIndentWithTabs(Source,Item^.Block.StartPos,DefaultTabWidth)]);
{$ENDIF}
if CheckPolicies(Policies,Item) then exit(true); if CheckPolicies(Policies,Item) then exit(true);
end; end;
end; end;
@ -1619,7 +1657,9 @@ begin
// parse source behind // parse source behind
ParseSource(Source,Item^.CleanPos,length(Source)+1,NewNestedComments,Stack,Policies); ParseSource(Source,Item^.CleanPos,length(Source)+1,NewNestedComments,Stack,Policies);
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed source behind']); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed source behind']);
{$ENDIF}
for ItemIndex:=0 to Positions.Count-1 do begin for ItemIndex:=0 to Positions.Count-1 do begin
Item:=@Positions.Items[ItemIndex]; Item:=@Positions.Items[ItemIndex];
if (not Item^.Indent.IndentValid) and (Item^.Block.Typ<>bbtNone) then if (not Item^.Indent.IndentValid) and (Item^.Block.Typ<>bbtNone) then
@ -1636,7 +1676,9 @@ begin
Item:=@Positions.Items[ItemIndex]; Item:=@Positions.Items[ItemIndex];
if (not Item^.Indent.IndentValid) and (Item^.Block.Typ<>bbtNone) then begin if (not Item^.Indent.IndentValid) and (Item^.Block.Typ<>bbtNone) then begin
Policies:=FindPolicyInExamples(nil,Item^.ParentBlock.Typ,Item^.Block.Typ); Policies:=FindPolicyInExamples(nil,Item^.ParentBlock.Typ,Item^.Block.Typ);
{$IFDEF VerboseIndenter}
DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed examples']); DebugLn(['TFullyAutomaticBeautifier.GetIndent parsed examples']);
{$ENDIF}
if (Policies<>nil) and CheckPolicies(Policies,Item) then if (Policies<>nil) and CheckPolicies(Policies,Item) then
exit(true); exit(true);
end; end;

View File

@ -430,7 +430,7 @@ begin
end; end;
end; end;
{$IFDEF EnableIndenter} {$IFDEF VerboseIndenter}
DebugLn(['TSynBeautifier.ApplyIndent IndentChars="',dbgstr(IndentChars),' Indent=',Indent]); DebugLn(['TSynBeautifier.ApplyIndent IndentChars="',dbgstr(IndentChars),' Indent=',Indent]);
{$ENDIF} {$ENDIF}
@ -439,7 +439,7 @@ begin
if (CharMix <> '') and not((FIndentType = sbitPositionCaret) and (FCurrentLines[LinePos-1] = '')) then if (CharMix <> '') and not((FIndentType = sbitPositionCaret) and (FCurrentLines[LinePos-1] = '')) then
FCurrentLines.EditInsert(1, LinePos, CharMix); FCurrentLines.EditInsert(1, LinePos, CharMix);
{$IFDEF EnableIndenter} {$IFDEF VerboseIndenter}
DebugLn(['TSynBeautifier.ApplyIndent Line="',dbgstr(FCurrentLines.ExpandedStrings[LinePos-1]),'"']); DebugLn(['TSynBeautifier.ApplyIndent Line="',dbgstr(FCurrentLines.ExpandedStrings[LinePos-1]),'"']);
{$ENDIF} {$ENDIF}
end; end;

View File

@ -6796,9 +6796,6 @@ begin
Reason, SetIndentProc); Reason, SetIndentProc);
if Result then exit; if Result then exit;
end; end;
{$IFNDEF EnableIndenter}
exit;
{$ENDIF}
if not CodeToolsOpts.IndentationEnabled then exit; if not CodeToolsOpts.IndentationEnabled then exit;
if not (SrcEdit.SyntaxHighlighterType in [lshFreePascal, lshDelphi]) then if not (SrcEdit.SyntaxHighlighterType in [lshFreePascal, lshDelphi]) then
exit; exit;
@ -6816,7 +6813,9 @@ begin
else else
exit; exit;
end; end;
{$IFDEF VerboseIndenter}
debugln(['TSourceNotebook.EditorGetIndent LogCaret=',dbgs(LogCaret),' FirstLinePos=',FirstLinePos,' LastLinePos=',LastLinePos]); debugln(['TSourceNotebook.EditorGetIndent LogCaret=',dbgs(LogCaret),' FirstLinePos=',FirstLinePos,' LastLinePos=',LastLinePos]);
{$ENDIF}
Result := True; Result := True;
SrcEdit.UpdateCodeBuffer; SrcEdit.UpdateCodeBuffer;
CodeBuf:=SrcEdit.CodeBuffer; CodeBuf:=SrcEdit.CodeBuffer;
@ -6827,42 +6826,56 @@ begin
CodeBuf.LineColToPosition(FirstLinePos,1,p); CodeBuf.LineColToPosition(FirstLinePos,1,p);
end; end;
if p<1 then exit; if p<1 then exit;
{$IFDEF VerboseIndenter}
if FirstLinePos>0 then if FirstLinePos>0 then
DebugLn(['TSourceNotebook.EditorGetIndent Firstline-1=',SrcEdit.Lines[FirstLinePos-1]]); DebugLn(['TSourceNotebook.EditorGetIndent Firstline-1=',SrcEdit.Lines[FirstLinePos-1]]);
DebugLn(['TSourceNotebook.EditorGetIndent Firstline+0=',SrcEdit.Lines[FirstLinePos]]); DebugLn(['TSourceNotebook.EditorGetIndent Firstline+0=',SrcEdit.Lines[FirstLinePos]]);
if FirstLinePos<SrcEdit.LineCount then if FirstLinePos<SrcEdit.LineCount then
DebugLn(['TSourceNotebook.EditorGetIndent Firstline+1=',SrcEdit.Lines[FirstLinePos+1]]); DebugLn(['TSourceNotebook.EditorGetIndent Firstline+1=',SrcEdit.Lines[FirstLinePos+1]]);
{$ENDIF}
NestedComments:=CodeToolBoss.GetNestedCommentsFlagForFile(CodeBuf.Filename); NestedComments:=CodeToolBoss.GetNestedCommentsFlagForFile(CodeBuf.Filename);
if not CodeToolBoss.Indenter.GetIndent(CodeBuf.Source,p,NestedComments, if not CodeToolBoss.Indenter.GetIndent(CodeBuf.Source,p,NestedComments,
true,NewIndent,CodeToolsOpts.IndentContextSensitive) true,NewIndent,CodeToolsOpts.IndentContextSensitive)
then exit; then exit;
if not NewIndent.IndentValid then exit; if not NewIndent.IndentValid then exit;
Indent:=NewIndent.Indent; Indent:=NewIndent.Indent;
{$IFDEF VerboseIndenter}
DebugLn(['TSourceNotebook.EditorGetIndent Indent=',Indent]); DebugLn(['TSourceNotebook.EditorGetIndent Indent=',Indent]);
{$ENDIF}
case Reason of case Reason of
ecLineBreak,ecInsertLine: ecLineBreak,ecInsertLine:
begin begin
{$IFDEF VerboseIndenter}
DebugLn(['TSourceNotebook.EditorGetIndent Apply to FirstLinePos+1']); DebugLn(['TSourceNotebook.EditorGetIndent Apply to FirstLinePos+1']);
{$ENDIF}
SetIndentProc(FirstLinePos+1, Indent, 0,' '); SetIndentProc(FirstLinePos+1, Indent, 0,' ');
SrcEdit.CursorScreenXY:=Point(Indent+1,SrcEdit.CursorScreenXY.Y); SrcEdit.CursorScreenXY:=Point(Indent+1,SrcEdit.CursorScreenXY.Y);
end; end;
ecPaste: ecPaste:
begin begin
{$IFDEF VerboseIndenter}
DebugLn(['TSourceNotebook.EditorGetIndent Apply to lines ',FirstLinePos,' .. ',LastLinePos]); DebugLn(['TSourceNotebook.EditorGetIndent Apply to lines ',FirstLinePos,' .. ',LastLinePos]);
{$ENDIF}
Line:=SrcEdit.EditorComponent.Lines[FirstLinePos-1]; Line:=SrcEdit.EditorComponent.Lines[FirstLinePos-1];
OldIndent:=GetLineIndentWithTabs(Line,1,SrcEdit.EditorComponent.TabWidth); OldIndent:=GetLineIndentWithTabs(Line,1,SrcEdit.EditorComponent.TabWidth);
{$IFDEF VerboseIndenter}
DebugLn(['TSourceNotebook.EditorGetIndent OldIndent=',OldIndent,' Line=',dbgstr(Line)]); DebugLn(['TSourceNotebook.EditorGetIndent OldIndent=',OldIndent,' Line=',dbgstr(Line)]);
{$ENDIF}
for i:=FirstLinePos to LastLinePos do begin for i:=FirstLinePos to LastLinePos do begin
if i>=SrcEdit.EditorComponent.Lines.Count then break; if i>=SrcEdit.EditorComponent.Lines.Count then break;
Line:=SrcEdit.EditorComponent.Lines[i-1]; Line:=SrcEdit.EditorComponent.Lines[i-1];
CurIndent:=GetLineIndentWithTabs(Line,1,SrcEdit.EditorComponent.TabWidth); CurIndent:=GetLineIndentWithTabs(Line,1,SrcEdit.EditorComponent.TabWidth);
{$IFDEF VerboseIndenter}
DebugLn(['TSourceNotebook.EditorGetIndent CurIndent=',CurIndent,' OldIndent=',OldIndent,' Indent=',Indent,' Line="',Line,'"']); DebugLn(['TSourceNotebook.EditorGetIndent CurIndent=',CurIndent,' OldIndent=',OldIndent,' Indent=',Indent,' Line="',Line,'"']);
{$ENDIF}
CurIndent:=CurIndent-OldIndent+Indent; CurIndent:=CurIndent-OldIndent+Indent;
if CurIndent<0 then begin if CurIndent<0 then begin
dec(Indent,CurIndent); dec(Indent,CurIndent);
CurIndent:=0; CurIndent:=0;
end; end;
{$IFDEF VerboseIndenter}
DebugLn(['TSourceNotebook.EditorGetIndent ']); DebugLn(['TSourceNotebook.EditorGetIndent ']);
{$ENDIF}
SetIndentProc(i, CurIndent, 0,' '); SetIndentProc(i, CurIndent, 0,' ');
end; end;
end; end;