mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 05:19:28 +02:00
SynEdit: improve screen caret lock
git-svn-id: trunk@34668 -
This commit is contained in:
parent
dfd850c0b7
commit
83ccf70cb2
@ -251,6 +251,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TSynCaretType = (ctVerticalLine, ctHorizontalLine, ctHalfBlock, ctBlock);
|
TSynCaretType = (ctVerticalLine, ctHorizontalLine, ctHalfBlock, ctBlock);
|
||||||
|
TSynCaretLockFlags = set of (sclfUpdateDisplay, sclfUpdateDisplayType);
|
||||||
|
|
||||||
{ TSynEditScreenCaret }
|
{ TSynEditScreenCaret }
|
||||||
|
|
||||||
@ -287,7 +288,7 @@ type
|
|||||||
FCurrentVisible, FCurrentCreated: Boolean;
|
FCurrentVisible, FCurrentCreated: Boolean;
|
||||||
FCurrentClippedWidth: Integer;
|
FCurrentClippedWidth: Integer;
|
||||||
FLockCount: Integer;
|
FLockCount: Integer;
|
||||||
FLockedUpdateNeeded: Boolean;
|
FLockFlags: TSynCaretLockFlags;
|
||||||
procedure SetClipBottom(const AValue: Integer);
|
procedure SetClipBottom(const AValue: Integer);
|
||||||
procedure SetClipExtraPixel(AValue: Integer);
|
procedure SetClipExtraPixel(AValue: Integer);
|
||||||
procedure SetClipLeft(const AValue: Integer);
|
procedure SetClipLeft(const AValue: Integer);
|
||||||
@ -1683,8 +1684,10 @@ end;
|
|||||||
procedure TSynEditScreenCaret.UnLock;
|
procedure TSynEditScreenCaret.UnLock;
|
||||||
begin
|
begin
|
||||||
dec(FLockCount);
|
dec(FLockCount);
|
||||||
if (FLockCount=0) and FLockedUpdateNeeded then
|
if (FLockCount=0) then begin
|
||||||
UpdateDisplay;
|
if (sclfUpdateDisplayType in FLockFlags) then UpdateDisplayType;
|
||||||
|
if (sclfUpdateDisplay in FLockFlags) then UpdateDisplay;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynEditScreenCaret.SetClipRight(const AValue: Integer);
|
procedure TSynEditScreenCaret.SetClipRight(const AValue: Integer);
|
||||||
@ -1744,6 +1747,12 @@ end;
|
|||||||
|
|
||||||
procedure TSynEditScreenCaret.UpdateDisplayType;
|
procedure TSynEditScreenCaret.UpdateDisplayType;
|
||||||
begin
|
begin
|
||||||
|
if FLockCount > 0 then begin
|
||||||
|
Include(FLockFlags, sclfUpdateDisplayType);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
Exclude(FLockFlags, sclfUpdateDisplayType);
|
||||||
|
|
||||||
case FDisplayType of
|
case FDisplayType of
|
||||||
ctVerticalLine:
|
ctVerticalLine:
|
||||||
begin
|
begin
|
||||||
@ -1845,10 +1854,11 @@ end;
|
|||||||
procedure TSynEditScreenCaret.UpdateDisplay;
|
procedure TSynEditScreenCaret.UpdateDisplay;
|
||||||
begin
|
begin
|
||||||
if FLockCount > 0 then begin
|
if FLockCount > 0 then begin
|
||||||
FLockedUpdateNeeded := True;
|
Include(FLockFlags, sclfUpdateDisplay);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
FLockedUpdateNeeded := False;
|
Exclude(FLockFlags, sclfUpdateDisplay);
|
||||||
|
|
||||||
if FVisible then
|
if FVisible then
|
||||||
ShowCaret
|
ShowCaret
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user