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:
martin 2009-08-01 16:02:05 +00:00
parent 83c9549975
commit 3985057ea0

View File

@ -908,8 +908,10 @@ var
s: string;
begin
s := Strings[LogY - 1];
if LogX - 1 > Length(s) then
if LogX - 1 > Length(s) then begin
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));
UndoList.AddChange(TSynEditUndoTxtInsert.Create(LogX, LogY, Length(AText)));
MarkModified(LogY, LogY);
@ -921,6 +923,8 @@ var
s: string;
begin
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));
UndoList.AddChange(TSynEditUndoTxtDelete.Create(LogX, LogY, Result));