codetools: identifier completion: fixed line index

git-svn-id: trunk@22519 -
This commit is contained in:
mattias 2009-11-10 12:14:19 +00:00
parent e50ada8891
commit 0fd3251391

View File

@ -1514,7 +1514,8 @@ begin
// get identifier position
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;
end;
@ -1552,7 +1553,7 @@ procedure TIdentCompletionTool.FindCollectionContext(
MoveCursorToCleanPos(IdentStartPos);
ReadPriorAtom;
if (CurPos.Flag=cafPoint)
or (UpAtomIs('INHERITED')) then begin
or UpAtomIs('INHERITED') then begin
Result:=FindStartOfTerm(IdentStartPos,NodeTermInType(ContextNode));
if Result<ContextNode.StartPos then
Result:=ContextNode.StartPos;