SynEdit: AutoComplete, fix GetPreviousToken use Logical pos

git-svn-id: trunk@42701 -
This commit is contained in:
martin 2013-09-09 13:19:34 +00:00
parent 3afb18b37f
commit abd94d0f29

View File

@ -1823,7 +1823,7 @@ var
begin
if FEditor <> nil then begin
s := FEditor.LineText;
i := FEditor.CaretX - 1;
i := FEditor.LogicalCaretXY.X - 1;
if i > length(s) then
result := ''
else begin
@ -1831,7 +1831,7 @@ begin
Begin
dec(i);
end;
result := copy(s, i + 1, FEditor.CaretX - i - 1);
result := copy(s, i + 1, FEditor.LogicalCaretXY.X - i - 1);
end;
end
else
@ -1942,13 +1942,13 @@ var
begin
if aEditor <> nil then begin
s := aEditor.LineText;
i := aEditor.CaretX - 1;
i := aEditor.LogicalCaretXY.X - 1;
if i > length(s) then
result := ''
else begin
while (i > 0) and (s[i] > ' ') and (pos(s[i], FEndOfTokenChr) = 0) do
dec(i);
result := copy(s, i + 1, aEditor.CaretX - i - 1);
result := copy(s, i + 1, aEditor.LogicalCaretXY.X - i - 1);
end;
end
else