codetools: fixed GetIdentStartEndAtPosition if pos behind source

git-svn-id: branches/fixes_1_8@56199 -
This commit is contained in:
mattias 2017-10-25 20:22:00 +00:00
parent 86165e04d5
commit 7626be6016

View File

@ -1823,11 +1823,13 @@ begin
while (IdentEnd<=length(Source))
and (IsIdentChar[Source[IdentEnd]]) do
inc(IdentEnd);
while (IdentStart<IdentEnd)
while (IdentStart<Position)
and (not IsIdentStartChar[Source[IdentStart]]) do
inc(IdentStart);
if (IdentStart>1) and (Source[IdentStart-1]='&') then
dec(IdentStart);
if (IdentStart>length(Source)) or not IsIdentStartChar[Source[IdentStart]] then
IdentEnd:=IdentStart;
end;
function GetIdentStartPosition(const Source: string; Position: integer