mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 17:19:19 +02:00
SynEdit: fix Selection.IncPersistentLock(weak) for newly inserted lines
git-svn-id: trunk@62419 -
This commit is contained in:
parent
139b0bab40
commit
050d7b2f7f
@ -1796,7 +1796,7 @@ end;
|
|||||||
procedure TSynEditSelection.DoLinesEdited(Sender: TSynEditStrings; aLinePos, aBytePos, aCount,
|
procedure TSynEditSelection.DoLinesEdited(Sender: TSynEditStrings; aLinePos, aBytePos, aCount,
|
||||||
aLineBrkCnt: Integer; aText: String);
|
aLineBrkCnt: Integer; aText: String);
|
||||||
|
|
||||||
function AdjustPoint(aPoint: Tpoint; AIsStart: Boolean): TPoint; inline;
|
function AdjustPoint(aPoint: Tpoint; AIsStart: Boolean): TPoint; //inline;
|
||||||
begin
|
begin
|
||||||
Result := aPoint;
|
Result := aPoint;
|
||||||
if aLineBrkCnt < 0 then begin
|
if aLineBrkCnt < 0 then begin
|
||||||
@ -1810,12 +1810,24 @@ procedure TSynEditSelection.DoLinesEdited(Sender: TSynEditStrings; aLinePos, aBy
|
|||||||
else
|
else
|
||||||
if aLineBrkCnt > 0 then begin
|
if aLineBrkCnt > 0 then begin
|
||||||
(* Lines Inserted *)
|
(* Lines Inserted *)
|
||||||
if (aPoint.y = aLinePos) and (aPoint.x >= aBytePos) then begin
|
|
||||||
Result.x := Result.x - aBytePos + 1;
|
|
||||||
Result.y := Result.y + aLineBrkCnt;
|
|
||||||
end;
|
|
||||||
if aPoint.y > aLinePos then begin
|
if aPoint.y > aLinePos then begin
|
||||||
Result.y := Result.y + aLineBrkCnt;
|
Result.y := Result.y + aLineBrkCnt;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (aPoint.y = aLinePos) and (aPoint.x >= aBytePos) then begin
|
||||||
|
if (aPoint.x = aBytePos) then begin
|
||||||
|
if (FWeakPersistentIdx > 0) and (FWeakPersistentIdx > FStrongPersistentIdx) then begin
|
||||||
|
if not AIsStart then
|
||||||
|
exit;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (FStrongPersistentIdx > 0) then begin
|
||||||
|
if AIsStart then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result.x := Result.x - aBytePos + 1;
|
||||||
|
Result.y := Result.y + aLineBrkCnt;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user