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

git-svn-id: trunk@58181 -
This commit is contained in:
martin 2018-06-08 10:19:06 +00:00
parent 62ba86833c
commit cc7bb6c248
2 changed files with 9 additions and 8 deletions

View File

@ -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;

View File

@ -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;