Commit cc7bb6c2 authored by Martin's avatar Martin 💬
Browse files

SynEdit: fix position of multi-caret (after EOL), when column selection is deleted. Issue #32161

git-svn-id: trunk@58181 -
parent 62ba8683
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment