mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 14:50:32 +02:00
codetools: GetIdentStartEndAtPosition: identifier at end of line
git-svn-id: trunk@33789 -
This commit is contained in:
parent
1cc509f495
commit
9c53e8ce9d
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user