mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 14:22:29 +01:00
SynEdit: Fixed inconsistency between SetCaretY/X (only one cord) and SetCaretXY (both). The latter would always clear selection if set (even if unchanged), the former only on change. The former was changed. Issue #20209
git-svn-id: trunk@35464 -
This commit is contained in:
parent
aee57b0b70
commit
f0452c78ad
@ -789,7 +789,7 @@ type
|
||||
function PrevWordLogicalPos(ABoundary: TLazSynWordBoundary = swbWordBegin): TPoint;
|
||||
procedure RecalcCharExtent;
|
||||
procedure RedoItem(Item: TSynEditUndoItem);
|
||||
procedure SetCaretXY(Value: TPoint); virtual;
|
||||
procedure SetCaretXY(Value: TPoint);
|
||||
procedure CaretChanged(Sender: TObject);
|
||||
procedure SetName(const Value: TComponentName); override;
|
||||
procedure SetReadOnly(Value: boolean); virtual;
|
||||
@ -3906,11 +3906,13 @@ end;
|
||||
|
||||
procedure TCustomSynEdit.SetCaretX(const Value: Integer);
|
||||
begin
|
||||
FCaret.ChangeOnTouch; // setting the caret always clears selection (even setting to current pos / no change)
|
||||
FCaret.CharPos := Value;
|
||||
end;
|
||||
|
||||
procedure TCustomSynEdit.SetCaretY(const Value: Integer);
|
||||
begin
|
||||
FCaret.ChangeOnTouch; // setting the caret always clears selection (even setting to current pos / no change)
|
||||
FCaret.LinePos := Value;
|
||||
end;
|
||||
|
||||
@ -3932,7 +3934,7 @@ end;
|
||||
procedure TCustomSynEdit.SetCaretXY(Value: TPoint);
|
||||
// physical position (screen)
|
||||
begin
|
||||
FCaret.ChangeOnTouch;
|
||||
FCaret.ChangeOnTouch; // setting the caret always clears selection (even setting to current pos / no change)
|
||||
FCaret.LineCharPos:= Value;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user