IDE: event assignment completion: fixed using beautify options for RValue

git-svn-id: trunk@12377 -
This commit is contained in:
mattias 2007-10-08 10:44:01 +00:00
parent 97e18a00f6
commit 2adfa195f3
2 changed files with 9 additions and 6 deletions

View File

@ -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

View File

@ -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