mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 06:38:13 +02:00
codetools: identifier completion: fixed line index
git-svn-id: trunk@22519 -
This commit is contained in:
parent
e50ada8891
commit
0fd3251391
@ -1514,7 +1514,8 @@ begin
|
|||||||
|
|
||||||
// get identifier position
|
// get identifier position
|
||||||
GetIdentStartEndAtPosition(Src,CleanCursorPos,IdentStartPos,IdentEndPos);
|
GetIdentStartEndAtPosition(Src,CleanCursorPos,IdentStartPos,IdentEndPos);
|
||||||
if CursorPos.X>CursorPos.Code.GetLineLength(CursorPos.Y)+1 then
|
//DebugLn(['TIdentCompletionTool.ParseSourceTillCollectionStart ',dbgstr(copy(Src,IdentStartPos,10)),' CursorPos.X=',CursorPos.X,' LineLen=',CursorPos.Code.GetLineLength(CursorPos.Y-1),' ',CursorPos.Code.getline(CursorPos.Y-1)]);
|
||||||
|
if CursorPos.X>CursorPos.Code.GetLineLength(CursorPos.Y-1)+1 then
|
||||||
IdentStartPos:=IdentEndPos;
|
IdentStartPos:=IdentEndPos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1552,7 +1553,7 @@ procedure TIdentCompletionTool.FindCollectionContext(
|
|||||||
MoveCursorToCleanPos(IdentStartPos);
|
MoveCursorToCleanPos(IdentStartPos);
|
||||||
ReadPriorAtom;
|
ReadPriorAtom;
|
||||||
if (CurPos.Flag=cafPoint)
|
if (CurPos.Flag=cafPoint)
|
||||||
or (UpAtomIs('INHERITED')) then begin
|
or UpAtomIs('INHERITED') then begin
|
||||||
Result:=FindStartOfTerm(IdentStartPos,NodeTermInType(ContextNode));
|
Result:=FindStartOfTerm(IdentStartPos,NodeTermInType(ContextNode));
|
||||||
if Result<ContextNode.StartPos then
|
if Result<ContextNode.StartPos then
|
||||||
Result:=ContextNode.StartPos;
|
Result:=ContextNode.StartPos;
|
||||||
|
Loading…
Reference in New Issue
Block a user