SynEdit: reduce duplicate status events

This commit is contained in:
Martin 2025-01-22 23:29:20 +01:00
parent 949a6339ac
commit fc08a7c13f

View File

@ -5430,7 +5430,8 @@ begin
inherited;
if WaitingForInitialSize then
exit;
inc(FDoingResizeLock);
inc(FDoingResizeLock); // prevent UpdateScrollBars;
IncStatusChangeLock; // defer status events
FScreenCaret.Lock;
try
FLeftGutter.RecalcBounds;
@ -5441,9 +5442,13 @@ begin
EnsureCursorPosVisible;
Exclude(fStateFlags, sfEnsureCursorPosAtResize);
finally
FScreenCaret.UnLock;
dec(FDoingResizeLock);
UpdateScrollBars;
try
FScreenCaret.UnLock;
dec(FDoingResizeLock);
UpdateScrollBars;
finally
DecStatusChangeLock;
end;
end;
//debugln('TCustomSynEdit.Resize ',dbgs(Width),',',dbgs(Height),',',dbgs(ClientWidth),',',dbgs(ClientHeight));
// SetLeftChar(LeftChar); //mh 2000-10-19