mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 07:59:44 +02:00
IDE: identifier completion: fixed getting indent for method completion
git-svn-id: trunk@26614 -
This commit is contained in:
parent
893f722018
commit
d69c4535fe
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user