mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 02:18:25 +02:00
SynEdit: more precise change indicator gutter. Issue #30152
git-svn-id: trunk@52474 -
This commit is contained in:
parent
2bdea5e7ad
commit
1c0abfedcb
@ -1981,13 +1981,13 @@ var
|
|||||||
FLines.EditInsert(LogCaretXY.X, LogCaretXY.Y, Value);
|
FLines.EditInsert(LogCaretXY.X, LogCaretXY.Y, Value);
|
||||||
FInternalCaret.BytePos := FInternalCaret.BytePos + Length(Value);
|
FInternalCaret.BytePos := FInternalCaret.BytePos + Length(Value);
|
||||||
end else begin
|
end else begin
|
||||||
|
FLines.EditLineBreak(LogCaretXY.X, LogCaretXY.Y);
|
||||||
if (P <> Start) or (LogCaretXY.X > 1 + length(FLines[ToIdx(LogCaretXY.Y)])) then begin
|
if (P <> Start) or (LogCaretXY.X > 1 + length(FLines[ToIdx(LogCaretXY.Y)])) then begin
|
||||||
SetString(Str, Value, P - Start);
|
SetString(Str, Value, P - Start);
|
||||||
FLines.EditInsert(LogCaretXY.X, LogCaretXY.Y, Str);
|
FLines.EditInsert(LogCaretXY.X, LogCaretXY.Y, Str);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Str := '';
|
Str := '';
|
||||||
FLines.EditLineBreak(LogCaretXY.X + (P - Start), LogCaretXY.Y);
|
|
||||||
Result := CountLines(P);
|
Result := CountLines(P);
|
||||||
if Result > 1 then
|
if Result > 1 then
|
||||||
FLines.EditLinesInsert(LogCaretXY.Y + 1, Result - 1);
|
FLines.EditLinesInsert(LogCaretXY.Y + 1, Result - 1);
|
||||||
|
@ -1333,15 +1333,22 @@ end;
|
|||||||
procedure TSynEditStringList.EditLineBreak(LogX, LogY: Integer);
|
procedure TSynEditStringList.EditLineBreak(LogX, LogY: Integer);
|
||||||
var
|
var
|
||||||
s: string;
|
s: string;
|
||||||
|
Y1, Y2: Integer;
|
||||||
begin
|
begin
|
||||||
IncIsInEditAction;
|
IncIsInEditAction;
|
||||||
if Count = 0 then Add('');
|
if Count = 0 then Add('');
|
||||||
s := Strings[LogY - 1];
|
s := Strings[LogY - 1];
|
||||||
|
Y1 := LogY;
|
||||||
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)
|
||||||
|
else
|
||||||
|
inc(Y1);
|
||||||
Insert(LogY, copy(s, LogX, length(s)));
|
Insert(LogY, copy(s, LogX, length(s)));
|
||||||
CurUndoList.AddChange(TSynEditUndoTxtLineBreak.Create(LogY));
|
CurUndoList.AddChange(TSynEditUndoTxtLineBreak.Create(LogY));
|
||||||
MarkModified(LogY, LogY + 1);
|
Y2 := LogY;
|
||||||
|
if LogX > 1 then
|
||||||
|
inc(Y2);
|
||||||
|
MarkModified(Y1, Y2);
|
||||||
SendNotification(senrEditAction, self, LogY, 1, LogX, 0, '');
|
SendNotification(senrEditAction, self, LogY, 1, LogX, 0, '');
|
||||||
DecIsInEditAction;
|
DecIsInEditAction;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user