mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:19:37 +02:00
SynEdit: Fixed issues, with new, empty Edit (overwrite mode) / issue #16602
git-svn-id: trunk@25804 -
This commit is contained in:
parent
887eaf9147
commit
86c35630a6
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -804,6 +804,7 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
if Count = 0 then fSynStrings.Add('');
|
||||
FlushNotificationCache;
|
||||
IgnoreSendNotification(senrEditAction, True);
|
||||
SaveText := AText;
|
||||
|
Loading…
Reference in New Issue
Block a user