From 2adfa195f3035f4096df9506118e30e9df914afb Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 8 Oct 2007 10:44:01 +0000 Subject: [PATCH] IDE: event assignment completion: fixed using beautify options for RValue git-svn-id: trunk@12377 - --- components/codetools/codecompletiontool.pas | 2 +- components/codetools/sourcechanger.pas | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index 9148d5093d..6ce3f960ff 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -5424,7 +5424,7 @@ var CleanCursorPos, Indent, insertPos: integer; then RValue:='@'+RValue; RValue:=':='+RValue; - SourceChangeCache.BeautifyCodeOptions.BeautifyStatement(RValue,0); + RValue:=SourceChangeCache.BeautifyCodeOptions.BeautifyStatement(RValue,0); StartInsertPos:=AssignmentOperator; EndInsertPos:=SemicolonPos+1; if EndInsertPos<1 then diff --git a/components/codetools/sourcechanger.pas b/components/codetools/sourcechanger.pas index dabea02ef7..88fe115fa1 100644 --- a/components/codetools/sourcechanger.pas +++ b/components/codetools/sourcechanger.pas @@ -1309,23 +1309,26 @@ begin else break; until false; + //DebugLn(['TBeautifyCodeOptions.BeautifyStatement ',CurAtom,' LastAtomType=',AtomTypeNames[LastAtomType],',',LastAtomType in DoNotInsertSpaceAfter,',',LastAtomType in DoInsertSpaceAfter,' CurAtomType=',AtomTypeNames[CurAtomType],',',CurAtomType in DoNotInsertSpaceInFront,',',CurAtomType in DoInsertSpaceInFront]); if ((Result='') or (Result[length(Result)]<>' ')) and (not (CurAtomType in DoNotInsertSpaceInFront)) and (not (LastAtomType in DoNotInsertSpaceAfter)) and ((CurAtomType in DoInsertSpaceInFront) or (LastAtomType in DoInsertSpaceAfter)) - then + then begin + //DebugLn(['TBeautifyCodeOptions.BeautifyStatement ADDING space']); AddAtom(Result,' '); - {if (CurAtomType=atIdentifier) and (LastAtomType=atColon) then begin - DebugLn('SPLIT LINE CurPos='+dbgs(CurPos)+' CurAtom="'+CurAtom+'"' + end; + if (CurAtomType=atIdentifier) and (LastAtomType=atColon) then begin + {DebugLn('SPLIT LINE CurPos='+dbgs(CurPos)+' CurAtom="'+CurAtom+'"' +' CurAtomType='+AtomTypeNames[CurAtomType] +' LastAtomType=',AtomTypeNames[LastAtomType] +' CurNot='+dbgs(CurAtomType in DoNotInsertSpaceInFront) +' LastNot='+dbgs(LastAtomType in DoNotInsertSpaceAfter) +' Cur='+dbgs(CurAtomType in DoInsertSpaceInFront) +' Last='+dbgs(LastAtomType in DoInsertSpaceAfter) - +' ..."'+copy(Result,length(Result)-10,10)+'"'); - end;} + +' ..."'+copy(Result,length(Result)-10,10)+'"');} + end; if (not (CurAtomType in DoNotSplitLineInFront)) and (not (LastAtomType in DoNotSplitLineAfter)) then