mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-10 18:22:55 +01:00
SynEdit: fix invalidate gutter-lines, if caret Viewed-Y changes
This commit is contained in:
parent
ce7acbe6cf
commit
2a874e1c87
@ -4864,8 +4864,11 @@ begin
|
|||||||
fStateFlags := fStateFlags - [sfExplicitTopLine, sfExplicitLeftChar];
|
fStateFlags := fStateFlags - [sfExplicitTopLine, sfExplicitLeftChar];
|
||||||
if FCaret.OldCharPos <> FCaret.CharPos then
|
if FCaret.OldCharPos <> FCaret.CharPos then
|
||||||
Include(fStatusChanges, scCaretX);
|
Include(fStatusChanges, scCaretX);
|
||||||
if FCaret.OldLinePos <> FCaret.LinePos then begin
|
if FCaret.OldLinePos <> FCaret.LinePos then
|
||||||
Include(fStatusChanges, scCaretY);
|
Include(fStatusChanges, scCaretY);
|
||||||
|
if (FCaret.OldViewedLineCharPos.Y < 0) or
|
||||||
|
(FCaret.OldViewedLineCharPos.Y <> FCaret.ViewedLineCharPos.y)
|
||||||
|
then begin
|
||||||
InvalidateGutterLines(FCaret.OldLinePos, FCaret.OldLinePos);
|
InvalidateGutterLines(FCaret.OldLinePos, FCaret.OldLinePos);
|
||||||
InvalidateGutterLines(FCaret.LinePos, FCaret.LinePos);
|
InvalidateGutterLines(FCaret.LinePos, FCaret.LinePos);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -332,6 +332,7 @@ type
|
|||||||
|
|
||||||
FOldLinePos: Integer; // 1 based
|
FOldLinePos: Integer; // 1 based
|
||||||
FOldCharPos: Integer; // 1 based
|
FOldCharPos: Integer; // 1 based
|
||||||
|
FOldViewedLineCharPos: TPoint;
|
||||||
|
|
||||||
FAdjustToNextChar: Boolean;
|
FAdjustToNextChar: Boolean;
|
||||||
FMaxLeftChar: TMaxLeftCharFunc;
|
FMaxLeftChar: TMaxLeftCharFunc;
|
||||||
@ -389,6 +390,7 @@ type
|
|||||||
property OldLineCharPos: TPoint read GetOldLineCharPos;
|
property OldLineCharPos: TPoint read GetOldLineCharPos;
|
||||||
property OldLineBytePos: TPoint read GetOldLineBytePos;
|
property OldLineBytePos: TPoint read GetOldLineBytePos;
|
||||||
property OldFullLogicalPos: TLogCaretPoint read GetOldFullLogicalPos;
|
property OldFullLogicalPos: TLogCaretPoint read GetOldFullLogicalPos;
|
||||||
|
property OldViewedLineCharPos: TPoint read FOldViewedLineCharPos;
|
||||||
|
|
||||||
property AdjustToNextChar: Boolean read FAdjustToNextChar write FAdjustToNextChar; deprecated;
|
property AdjustToNextChar: Boolean read FAdjustToNextChar write FAdjustToNextChar; deprecated;
|
||||||
property SkipTabs: Boolean read FSkipTabs write SetSkipTabs;
|
property SkipTabs: Boolean read FSkipTabs write SetSkipTabs;
|
||||||
@ -1108,6 +1110,13 @@ begin
|
|||||||
//ValidateBytePos;
|
//ValidateBytePos;
|
||||||
FOldCharPos := FCharPos;
|
FOldCharPos := FCharPos;
|
||||||
FOldLinePos := FLinePos;
|
FOldLinePos := FLinePos;
|
||||||
|
if scViewedPosValid in FFlags then begin
|
||||||
|
FOldViewedLineCharPos := FViewedLineCharPos;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
FOldViewedLineCharPos.x := -1;
|
||||||
|
FOldViewedLineCharPos.y := -1;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynEditCaret.DoUnlock;
|
procedure TSynEditCaret.DoUnlock;
|
||||||
@ -1125,6 +1134,13 @@ begin
|
|||||||
FTouched := False;
|
FTouched := False;
|
||||||
FOldCharPos := FCharPos;
|
FOldCharPos := FCharPos;
|
||||||
FOldLinePos := FLinePos;
|
FOldLinePos := FLinePos;
|
||||||
|
if scViewedPosValid in FFlags then begin
|
||||||
|
FOldViewedLineCharPos := FViewedLineCharPos;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
FOldViewedLineCharPos.x := -1;
|
||||||
|
FOldViewedLineCharPos.y := -1;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynEditCaret.SetLines(const AValue: TSynEditStringsLinked);
|
procedure TSynEditCaret.SetLines(const AValue: TSynEditStringsLinked);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user