codetools: GetIdentStartEndAtPosition: identifier at end of line

git-svn-id: trunk@33789 -
This commit is contained in:
mattias 2011-11-26 01:48:38 +00:00
parent 1cc509f495
commit 9c53e8ce9d

View File

@ -1559,7 +1559,7 @@ procedure GetIdentStartEndAtPosition(const Source: string; Position: integer;
begin begin
IdentStart:=Position; IdentStart:=Position;
IdentEnd:=Position; IdentEnd:=Position;
if (Position<1) or (Position>length(Source)) then exit; if (Position<1) or (Position>length(Source)+1) then exit;
while (IdentStart>1) while (IdentStart>1)
and (IsIdentChar[Source[IdentStart-1]]) do and (IsIdentChar[Source[IdentStart-1]]) do
dec(IdentStart); dec(IdentStart);
@ -1575,7 +1575,7 @@ function GetIdentStartPosition(const Source: string; Position: integer
): integer; ): integer;
begin begin
Result:=Position; Result:=Position;
if (Result<1) or (Result>length(Source)) then exit; if (Result<1) or (Result>length(Source)+1) then exit;
while (Result>1) while (Result>1)
and (IsIdentChar[Source[Result-1]]) do and (IsIdentChar[Source[Result-1]]) do
dec(Result); dec(Result);