mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +02:00
SynEdit: AutoComplete, fix GetPreviousToken use Logical pos
git-svn-id: trunk@42701 -
This commit is contained in:
parent
3afb18b37f
commit
abd94d0f29
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user