mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 18:58:17 +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
|
if (StackIndex<Stack.Top) then begin
|
||||||
// block(s) closed by next token
|
// block(s) closed by next token
|
||||||
// use indent of block start
|
// 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.Indent:=GetLineIndentWithTabs(Source,Block.StartPos,DefaultTabWidth);
|
||||||
Indent.IndentValid:=true;
|
Indent.IndentValid:=true;
|
||||||
exit(true);
|
exit(true);
|
||||||
|
@ -1579,6 +1579,7 @@ begin
|
|||||||
GatherContext:=CreateFindContext(Self,CursorNode);
|
GatherContext:=CreateFindContext(Self,CursorNode);
|
||||||
|
|
||||||
IgnoreCurContext:=false;
|
IgnoreCurContext:=false;
|
||||||
|
//DebugLn(['TIdentCompletionTool.FindCollectionContext IdentStartPos=',dbgstr(copy(Src,IdentStartPos,20))]);
|
||||||
ContextExprStartPos:=GetContextExprStartPos(IdentStartPos,CursorNode);
|
ContextExprStartPos:=GetContextExprStartPos(IdentStartPos,CursorNode);
|
||||||
if GatherContext.Node.Desc=ctnWithVariable then begin
|
if GatherContext.Node.Desc=ctnWithVariable then begin
|
||||||
if GatherContext.Node.PriorBrother<>nil then
|
if GatherContext.Node.PriorBrother<>nil then
|
||||||
|
@ -321,12 +321,9 @@ end;
|
|||||||
function TSourceLog.GetLineLength(Index: integer): integer;
|
function TSourceLog.GetLineLength(Index: integer): integer;
|
||||||
begin
|
begin
|
||||||
BuildLineRanges;
|
BuildLineRanges;
|
||||||
if (Index>=0) and (Index<fLineCount) then begin
|
if (Index>=0) and (Index<fLineCount) then
|
||||||
if Index<fLineCount-1 then
|
Result:=fLineRanges[Index].EndPos-fLineRanges[Index].StartPos
|
||||||
Result:=fLineRanges[Index+1].EndPos-fLineRanges[Index+1].StartPos
|
else
|
||||||
else
|
|
||||||
Result:=fSrcLen-fLineRanges[Index].StartPos;
|
|
||||||
end else
|
|
||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user