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