mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 06:55:59 +02:00
SynEdit: Small optimization in editing selection code
git-svn-id: trunk@40679 -
This commit is contained in:
parent
0493e2f195
commit
fde480b560
@ -1655,9 +1655,13 @@ var
|
||||
FLines.EditInsert(LogCaretXY.X, LogCaretXY.Y, Value);
|
||||
FInternalCaret.BytePos := FInternalCaret.BytePos + Length(Value);
|
||||
end else begin
|
||||
SetString(Str, Value, P - Start);
|
||||
FLines.EditInsert(LogCaretXY.X, LogCaretXY.Y, Str);
|
||||
FLines.EditLineBreak(LogCaretXY.X + Length(Str), LogCaretXY.Y);
|
||||
if (P <> Start) or (LogCaretXY.X > 1 + length(FLines[ToIdx(LogCaretXY.Y)])) then begin
|
||||
SetString(Str, Value, P - Start);
|
||||
FLines.EditInsert(LogCaretXY.X, LogCaretXY.Y, Str);
|
||||
end
|
||||
else
|
||||
Str := '';
|
||||
FLines.EditLineBreak(LogCaretXY.X + (P - Start), LogCaretXY.Y);
|
||||
Result := CountLines(P);
|
||||
if Result > 1 then
|
||||
FLines.EditLinesInsert(LogCaretXY.Y + 1, Result - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user