mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 10:19:36 +02:00
SynEdit small optimization (unnecessary call to shiftstate)
git-svn-id: trunk@21010 -
This commit is contained in:
parent
a5da38b431
commit
ea95a7e23c
@ -1765,7 +1765,8 @@ begin
|
|||||||
UpdateScrollbars;
|
UpdateScrollbars;
|
||||||
// must be past UpdateScrollbars; but before UpdateCaret (for ScrollBar-Auto-show)
|
// must be past UpdateScrollbars; but before UpdateCaret (for ScrollBar-Auto-show)
|
||||||
if sfEnsureCursorPos in fStateFlags then
|
if sfEnsureCursorPos in fStateFlags then
|
||||||
EnsureCursorPosVisible;
|
EnsureCursorPosVisible; // TODO: This may call SetTopLine, change order
|
||||||
|
// This does Paintlock, should be before final decrease
|
||||||
// Must be after EnsureCursorPosVisible (as it does MoveCaretToVisibleArea)
|
// Must be after EnsureCursorPosVisible (as it does MoveCaretToVisibleArea)
|
||||||
if sfCaretChanged in fStateFlags then
|
if sfCaretChanged in fStateFlags then
|
||||||
UpdateCaret;
|
UpdateCaret;
|
||||||
@ -1773,7 +1774,8 @@ begin
|
|||||||
// UpdateScrollbars;
|
// UpdateScrollbars;
|
||||||
if fStatusChanges <> [] then
|
if fStatusChanges <> [] then
|
||||||
DoOnStatusChange(fStatusChanges);
|
DoOnStatusChange(fStatusChanges);
|
||||||
fMarkupHighCaret.CheckState; // Todo need a global lock, including the markup
|
fMarkupHighCaret.CheckState; // Todo: need a global lock, including the markup
|
||||||
|
// Todo: Markup can do invalidation, should be before ScrollAfterTopLineChanged;
|
||||||
end;
|
end;
|
||||||
if (fPaintLock = 0) then
|
if (fPaintLock = 0) then
|
||||||
FBlockSelection.AutoExtend := False;
|
FBlockSelection.AutoExtend := False;
|
||||||
@ -2215,7 +2217,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
inherited;
|
inherited;
|
||||||
if assigned(fMarkupCtrlMouse) then
|
if assigned(fMarkupCtrlMouse) then
|
||||||
fMarkupCtrlMouse.UpdateCtrlState;
|
fMarkupCtrlMouse.UpdateCtrlState(Shift);
|
||||||
UpdateCursor;
|
UpdateCursor;
|
||||||
Data := nil;
|
Data := nil;
|
||||||
C := #0;
|
C := #0;
|
||||||
@ -2266,7 +2268,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
inherited KeyUp(Key, Shift);
|
inherited KeyUp(Key, Shift);
|
||||||
if assigned(fMarkupCtrlMouse) then
|
if assigned(fMarkupCtrlMouse) then
|
||||||
fMarkupCtrlMouse.UpdateCtrlState;
|
fMarkupCtrlMouse.UpdateCtrlState(Shift);
|
||||||
UpdateCursor;
|
UpdateCursor;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure SetLines(const AValue : TSynEditStrings); override;
|
procedure SetLines(const AValue : TSynEditStrings); override;
|
||||||
public
|
public
|
||||||
procedure UpdateCtrlState;
|
procedure UpdateCtrlState(aShift: TShiftState);
|
||||||
procedure UpdateCtrlMouse;
|
procedure UpdateCtrlMouse;
|
||||||
property LastMouseCaret: TPoint read FLastMouseCaret write SetLastMouseCaret;
|
property LastMouseCaret: TPoint read FLastMouseCaret write SetLastMouseCaret;
|
||||||
public
|
public
|
||||||
@ -95,9 +95,9 @@ begin
|
|||||||
UpdateCtrlMouse;
|
UpdateCtrlMouse;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynEditMarkupCtrlMouseLink.UpdateCtrlState;
|
procedure TSynEditMarkupCtrlMouseLink.UpdateCtrlState(aShift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if FLastControlIsPressed <> IsCtrlMouseShiftState(GetKeyShiftState) then
|
if FLastControlIsPressed <> IsCtrlMouseShiftState(aShift) then
|
||||||
UpdateCtrlMouse;
|
UpdateCtrlMouse;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user