mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 10:29:29 +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,
|
ecInsertLine,
|
||||||
ecLineBreak:
|
ecLineBreak:
|
||||||
if not ReadOnly then begin
|
if not ReadOnly then begin
|
||||||
if FTheLinesView.Count = 0 then
|
|
||||||
FTheLinesView.Add('');
|
|
||||||
if SelAvail and (not FBlockSelection.Persistent) and (eoOverwriteBlock in fOptions2) then
|
if SelAvail and (not FBlockSelection.Persistent) and (eoOverwriteBlock in fOptions2) then
|
||||||
SetSelTextExternal('');
|
SetSelTextExternal('');
|
||||||
Temp := LineText;
|
Temp := LineText;
|
||||||
@ -6112,7 +6110,7 @@ begin
|
|||||||
LogCaretXY := FCaret.LineBytePos;
|
LogCaretXY := FCaret.LineBytePos;
|
||||||
Temp := LineText;
|
Temp := LineText;
|
||||||
Len := Length(Temp);
|
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);
|
counter := GetCharLen(Temp,LogCaretXY.X);
|
||||||
FTheLinesView.EditDelete(LogCaretXY.X, LogCaretXY.Y, counter);
|
FTheLinesView.EditDelete(LogCaretXY.X, LogCaretXY.Y, counter);
|
||||||
Len := Len - counter;
|
Len := Len - counter;
|
||||||
@ -6148,8 +6146,6 @@ begin
|
|||||||
else if not ReadOnly and (AChar = #13) then begin
|
else if not ReadOnly and (AChar = #13) then begin
|
||||||
// ecLineBreak is not assigned
|
// ecLineBreak is not assigned
|
||||||
// Insert a linebreak, but do not apply any other functionality (such as indent)
|
// 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
|
if SelAvail and (not FBlockSelection.Persistent) and (eoOverwriteBlock in fOptions2) then
|
||||||
SetSelTextExternal('');
|
SetSelTextExternal('');
|
||||||
LogCaretXY:=PhysicalToLogicalPos(CaretXY);
|
LogCaretXY:=PhysicalToLogicalPos(CaretXY);
|
||||||
|
@ -997,6 +997,7 @@ procedure TSynEditStringList.EditLineBreak(LogX, LogY: Integer);
|
|||||||
var
|
var
|
||||||
s: string;
|
s: string;
|
||||||
begin
|
begin
|
||||||
|
if Count = 0 then Add('');
|
||||||
s := Strings[LogY - 1];
|
s := Strings[LogY - 1];
|
||||||
if LogX - 1 < length(s) then
|
if LogX - 1 < length(s) then
|
||||||
Strings[LogY - 1] := copy(s, 1, LogX - 1);
|
Strings[LogY - 1] := copy(s, 1, LogX - 1);
|
||||||
|
@ -804,6 +804,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if Count = 0 then fSynStrings.Add('');
|
||||||
FlushNotificationCache;
|
FlushNotificationCache;
|
||||||
IgnoreSendNotification(senrEditAction, True);
|
IgnoreSendNotification(senrEditAction, True);
|
||||||
SaveText := AText;
|
SaveText := AText;
|
||||||
|
Loading…
Reference in New Issue
Block a user