IDE: identifier completion: fixed getting indent for method completion

git-svn-id: trunk@26614 -
This commit is contained in:
mattias 2010-07-13 08:18:36 +00:00
parent 893f722018
commit d69c4535fe

View File

@ -520,6 +520,7 @@ var
IsReadOnly: Boolean; IsReadOnly: Boolean;
Line: string; Line: string;
Indent: LongInt; Indent: LongInt;
StartContextPos: TCodeXYPosition;
begin begin
Result:=''; Result:='';
CursorToLeft:=0; CursorToLeft:=0;
@ -627,14 +628,12 @@ begin
if ProcModifierPos>0 then if ProcModifierPos>0 then
Result:=copy(Result,1,ProcModifierPos-1) Result:=copy(Result,1,ProcModifierPos-1)
+copy(Result,ProcModifierPos+9,length(Result)); +copy(Result,ProcModifierPos+9,length(Result));
with CodeToolBoss.IdentifierList.StartContextPos do begin StartContextPos:=CodeToolBoss.IdentifierList.StartContextPos;
Line:=Code.GetLine(Y); Line:=StartContextPos.Code.GetLine(StartContextPos.Y-1);
if InEmptyLine(Line,1) then Indent:=StartContextPos.X;
Indent:=X //debugln(['GetIdentCompletionValue ',Indent,' "',dbgstr(Line),'" ',GetLineIndent(Line,1),' empty=',InEmptyLine(Line,1),' ',DbgsCXY(StartContextPos)]);
else if not InEmptyLine(Line,1) then
Indent:=GetLineIndent(Line,X); Indent:=GetLineIndent(Line,1);
end;
Result:=TrimLeft(CodeToolBoss.SourceChangeCache Result:=TrimLeft(CodeToolBoss.SourceChangeCache
.BeautifyCodeOptions.BeautifyProc(Result,Indent,false)); .BeautifyCodeOptions.BeautifyProc(Result,Indent,false));
//debugln(['GetIdentCompletionValue ',dbgstr(Result),' LineLen=',CodeToolBoss.SourceChangeCache.BeautifyCodeOptions.LineLength]); //debugln(['GetIdentCompletionValue ',dbgstr(Result),' LineLen=',CodeToolBoss.SourceChangeCache.BeautifyCodeOptions.LineLength]);