mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 21:30:04 +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
components/synedit
@ -1939,7 +1939,8 @@ var
|
||||
FInternalCaret.LineCharPos := Point(l, y);
|
||||
xb := FInternalCaret.BytePos;
|
||||
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
|
||||
FLines.EditDelete(xb, y, xe - xb);
|
||||
end;
|
||||
|
@ -1281,13 +1281,13 @@ begin
|
||||
exit;
|
||||
IncIsInEditAction;
|
||||
s := Strings[LogY - 1];
|
||||
if LogX - 1 > Length(s) then
|
||||
exit;
|
||||
Result := copy(s, LogX, ByteLen);
|
||||
Strings[LogY - 1] := copy(s,1, LogX - 1) + copy(s, LogX + ByteLen, length(s));
|
||||
if Result <> '' then
|
||||
CurUndoList.AddChange(TSynEditUndoTxtDelete.Create(LogX, LogY, Result));
|
||||
MarkModified(LogY, LogY);
|
||||
if LogX - 1 <= Length(s) then begin
|
||||
Result := copy(s, LogX, ByteLen);
|
||||
Strings[LogY - 1] := copy(s,1, LogX - 1) + copy(s, LogX + ByteLen, length(s));
|
||||
if Result <> '' then
|
||||
CurUndoList.AddChange(TSynEditUndoTxtDelete.Create(LogX, LogY, Result));
|
||||
MarkModified(LogY, LogY);
|
||||
end;
|
||||
SendNotification(senrEditAction, self, LogY, 0, LogX, -ByteLen, '');
|
||||
DecIsInEditAction;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user