mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 15:56:08 +02:00
codetools: identifier completion: fixed GetLineLength
git-svn-id: trunk@22521 -
This commit is contained in:
parent
d39dca6458
commit
443f653af0
@ -1582,6 +1582,9 @@ begin
|
||||
if (StackIndex<Stack.Top) then begin
|
||||
// block(s) closed by next token
|
||||
// use indent of block start
|
||||
{$IFDEF VerboseIndenter}
|
||||
//DebugLn(['TFullyAutomaticBeautifier.GetIndent next token close block: ',FABBlockTypeNames[Stack.TOperation]]);
|
||||
{$ENDIF}
|
||||
Indent.Indent:=GetLineIndentWithTabs(Source,Block.StartPos,DefaultTabWidth);
|
||||
Indent.IndentValid:=true;
|
||||
exit(true);
|
||||
|
@ -1579,6 +1579,7 @@ begin
|
||||
GatherContext:=CreateFindContext(Self,CursorNode);
|
||||
|
||||
IgnoreCurContext:=false;
|
||||
//DebugLn(['TIdentCompletionTool.FindCollectionContext IdentStartPos=',dbgstr(copy(Src,IdentStartPos,20))]);
|
||||
ContextExprStartPos:=GetContextExprStartPos(IdentStartPos,CursorNode);
|
||||
if GatherContext.Node.Desc=ctnWithVariable then begin
|
||||
if GatherContext.Node.PriorBrother<>nil then
|
||||
|
@ -321,12 +321,9 @@ end;
|
||||
function TSourceLog.GetLineLength(Index: integer): integer;
|
||||
begin
|
||||
BuildLineRanges;
|
||||
if (Index>=0) and (Index<fLineCount) then begin
|
||||
if Index<fLineCount-1 then
|
||||
Result:=fLineRanges[Index+1].EndPos-fLineRanges[Index+1].StartPos
|
||||
else
|
||||
Result:=fSrcLen-fLineRanges[Index].StartPos;
|
||||
end else
|
||||
if (Index>=0) and (Index<fLineCount) then
|
||||
Result:=fLineRanges[Index].EndPos-fLineRanges[Index].StartPos
|
||||
else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user