mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:59:13 +02:00
SynEdit: fixed an issue with undo if eoScrollPastEOL and NO-TrimmSpace is set. Padding spaces for text inserted past eol was not undone
git-svn-id: trunk@21058 -
This commit is contained in:
parent
83c9549975
commit
3985057ea0
@ -908,8 +908,10 @@ var
|
|||||||
s: string;
|
s: string;
|
||||||
begin
|
begin
|
||||||
s := Strings[LogY - 1];
|
s := Strings[LogY - 1];
|
||||||
if LogX - 1 > Length(s) then
|
if LogX - 1 > Length(s) then begin
|
||||||
AText := StringOfChar(' ', LogX - 1 - Length(s)) + AText;
|
AText := StringOfChar(' ', LogX - 1 - Length(s)) + AText;
|
||||||
|
LogX := Length(s) + 1;
|
||||||
|
end;
|
||||||
Strings[LogY - 1] := copy(s,1, LogX - 1) + AText + copy(s, LogX, length(s));
|
Strings[LogY - 1] := copy(s,1, LogX - 1) + AText + copy(s, LogX, length(s));
|
||||||
UndoList.AddChange(TSynEditUndoTxtInsert.Create(LogX, LogY, Length(AText)));
|
UndoList.AddChange(TSynEditUndoTxtInsert.Create(LogX, LogY, Length(AText)));
|
||||||
MarkModified(LogY, LogY);
|
MarkModified(LogY, LogY);
|
||||||
@ -921,6 +923,8 @@ var
|
|||||||
s: string;
|
s: string;
|
||||||
begin
|
begin
|
||||||
s := Strings[LogY - 1];
|
s := Strings[LogY - 1];
|
||||||
|
if LogX - 1 > Length(s) then
|
||||||
|
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));
|
||||||
UndoList.AddChange(TSynEditUndoTxtDelete.Create(LogX, LogY, Result));
|
UndoList.AddChange(TSynEditUndoTxtDelete.Create(LogX, LogY, Result));
|
||||||
|
Loading…
Reference in New Issue
Block a user