mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 02:10:08 +02:00
IDE: SourceEditor, fix InsertLine. Issue #41409 Patch by Frank Fischer
(cherry picked from commit f3de1146b5
)
This commit is contained in:
parent
c3aad38ff3
commit
bdd77a1902
@ -5657,15 +5657,18 @@ const
|
||||
MarksMode: array[Boolean] of TSynMarksAdjustMode = (smaMoveUp, smaKeep);
|
||||
var
|
||||
Pt: TPoint;
|
||||
NewLine: String;
|
||||
begin
|
||||
if not ReadOnly then
|
||||
begin
|
||||
if StartLine > 1 then
|
||||
Pt := Point(Length(FEditor.Lines[StartLine - 2]) + 1, StartLine - 1)
|
||||
else
|
||||
if StartLine > 1 then begin
|
||||
Pt := Point(Length(FEditor.Lines[StartLine - 2]) + 1, StartLine - 1);
|
||||
NewLine := LineEnding + NewText;
|
||||
end else begin
|
||||
Pt := Point(1, 1);
|
||||
FEditor.SetTextBetweenPoints(Pt, Pt,
|
||||
LineEnding + NewText, [], scamEnd, MarksMode[aKeepMarks]);
|
||||
NewLine := NewText + LineEnding;
|
||||
end;
|
||||
FEditor.SetTextBetweenPoints(Pt, Pt, NewLine, [], scamEnd, MarksMode[aKeepMarks]);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user