IDE: auto ident: added debugging

git-svn-id: trunk@22317 -
This commit is contained in:
mattias 2009-10-28 12:53:15 +00:00
parent 81cea79ed2
commit 84db9b3f2f
2 changed files with 9 additions and 5 deletions

View File

@ -38,12 +38,13 @@
Examples for beautification styles: see scanexamples/indentation.pas
ToDo:
- if true then
exit;|
|
- selection
- fix last line after pressing return key:
if true then
exit;|
|
- if true then |
|exit;
- paste
}
unit CodeBeautifier;
@ -1079,7 +1080,7 @@ begin
Policies.Code.Source:=Source;
{$ENDIF}
// parse source in front
//DebugLn(['TFullyAutomaticBeautifier.GetIndent "',copy(Source,1,CleanPos-1),'"']);
DebugLn(['TFullyAutomaticBeautifier.GetIndent "',dbgstr(copy(Source,CleanPos-10,10)),'|',dbgstr(copy(Source,CleanPos,10)),'"']);
ParseSource(Source,1,CleanPos,NewNestedComments,Stack,Policies,
LastAtomStart,LastAtomEnd);
WriteDebugReport('After parsing code in front:',Stack);

View File

@ -14451,6 +14451,9 @@ begin
CodeBuf:=SrcEditor.CodeBuffer;
CodeBuf.LineColToPosition(LogCaret.Y,LogCaret.X,p);
if p<1 then exit;
DebugLn(['TMainIDE.OnSrcNoteBookGetIndent Firstline+0=',SrcEditor.Lines[FirstLinePos]]);
if FirstLinePos<SrcEditor.LineCount then
DebugLn(['TMainIDE.OnSrcNoteBookGetIndent Firstline+1=',SrcEditor.Lines[FirstLinePos+1]]);
NestedComments:=CodeToolBoss.GetNestedCommentsFlagForFile(CodeBuf.Filename);
if not CodeToolBoss.Indenter.GetIndent(CodeBuf.Source,p,NestedComments,NewIndent)
then exit;