From 84db9b3f2f7d00e95b9e65fac84cd8996b4cc916 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 28 Oct 2009 12:53:15 +0000 Subject: [PATCH] IDE: auto ident: added debugging git-svn-id: trunk@22317 - --- components/codetools/codebeautifier.pas | 11 ++++++----- ide/main.pp | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/components/codetools/codebeautifier.pas b/components/codetools/codebeautifier.pas index 9d917817dd..45afb0a237 100644 --- a/components/codetools/codebeautifier.pas +++ b/components/codetools/codebeautifier.pas @@ -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); diff --git a/ide/main.pp b/ide/main.pp index 63a42453a7..7a1ac8330a 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -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