SynEdit: Fixed issues, with new, empty Edit (overwrite mode) / issue #16602

git-svn-id: trunk@25804 -
This commit is contained in:
martin 2010-05-31 17:49:55 +00:00
parent 887eaf9147
commit 86c35630a6
3 changed files with 3 additions and 5 deletions

View File

@ -6069,8 +6069,6 @@ begin
ecInsertLine,
ecLineBreak:
if not ReadOnly then begin
if FTheLinesView.Count = 0 then
FTheLinesView.Add('');
if SelAvail and (not FBlockSelection.Persistent) and (eoOverwriteBlock in fOptions2) then
SetSelTextExternal('');
Temp := LineText;
@ -6112,7 +6110,7 @@ begin
LogCaretXY := FCaret.LineBytePos;
Temp := LineText;
Len := Length(Temp);
if (not fInserting) and (LogCaretXY.X - 1<= Len) then begin
if (not fInserting) and (LogCaretXY.X - 1 < Len) then begin
counter := GetCharLen(Temp,LogCaretXY.X);
FTheLinesView.EditDelete(LogCaretXY.X, LogCaretXY.Y, counter);
Len := Len - counter;
@ -6148,8 +6146,6 @@ begin
else if not ReadOnly and (AChar = #13) then begin
// ecLineBreak is not assigned
// Insert a linebreak, but do not apply any other functionality (such as indent)
if FTheLinesView.Count = 0 then
FTheLinesView.Add('');
if SelAvail and (not FBlockSelection.Persistent) and (eoOverwriteBlock in fOptions2) then
SetSelTextExternal('');
LogCaretXY:=PhysicalToLogicalPos(CaretXY);

View File

@ -997,6 +997,7 @@ procedure TSynEditStringList.EditLineBreak(LogX, LogY: Integer);
var
s: string;
begin
if Count = 0 then Add('');
s := Strings[LogY - 1];
if LogX - 1 < length(s) then
Strings[LogY - 1] := copy(s, 1, LogX - 1);

View File

@ -804,6 +804,7 @@ begin
exit;
end;
if Count = 0 then fSynStrings.Add('');
FlushNotificationCache;
IgnoreSendNotification(senrEditAction, True);
SaveText := AText;