mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 10:00:33 +02:00
SynEdit: fix position of multi-caret (after EOL), when column selection is deleted. Issue #0032161
git-svn-id: trunk@58181 -
This commit is contained in:
parent
62ba86833c
commit
cc7bb6c248
@ -1939,7 +1939,8 @@ var
|
|||||||
FInternalCaret.LineCharPos := Point(l, y);
|
FInternalCaret.LineCharPos := Point(l, y);
|
||||||
xb := FInternalCaret.BytePos;
|
xb := FInternalCaret.BytePos;
|
||||||
FInternalCaret.LineCharPos := Point(r, y);
|
FInternalCaret.LineCharPos := Point(r, y);
|
||||||
xe := Min(FInternalCaret.BytePos, 1 + length(FInternalCaret.LineText));
|
// xe := Min(FInternalCaret.BytePos, 1 + length(FInternalCaret.LineText));
|
||||||
|
xe := FInternalCaret.BytePos;
|
||||||
if xe > xb then
|
if xe > xb then
|
||||||
FLines.EditDelete(xb, y, xe - xb);
|
FLines.EditDelete(xb, y, xe - xb);
|
||||||
end;
|
end;
|
||||||
|
@ -1281,13 +1281,13 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
IncIsInEditAction;
|
IncIsInEditAction;
|
||||||
s := Strings[LogY - 1];
|
s := Strings[LogY - 1];
|
||||||
if LogX - 1 > Length(s) then
|
if LogX - 1 <= Length(s) then begin
|
||||||
exit;
|
|
||||||
Result := copy(s, LogX, ByteLen);
|
Result := copy(s, LogX, ByteLen);
|
||||||
Strings[LogY - 1] := copy(s,1, LogX - 1) + copy(s, LogX + ByteLen, length(s));
|
Strings[LogY - 1] := copy(s,1, LogX - 1) + copy(s, LogX + ByteLen, length(s));
|
||||||
if Result <> '' then
|
if Result <> '' then
|
||||||
CurUndoList.AddChange(TSynEditUndoTxtDelete.Create(LogX, LogY, Result));
|
CurUndoList.AddChange(TSynEditUndoTxtDelete.Create(LogX, LogY, Result));
|
||||||
MarkModified(LogY, LogY);
|
MarkModified(LogY, LogY);
|
||||||
|
end;
|
||||||
SendNotification(senrEditAction, self, LogY, 0, LogX, -ByteLen, '');
|
SendNotification(senrEditAction, self, LogY, 0, LogX, -ByteLen, '');
|
||||||
DecIsInEditAction;
|
DecIsInEditAction;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user