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