mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 05:37:23 +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];
|
||||
if FCaret.OldCharPos <> FCaret.CharPos then
|
||||
Include(fStatusChanges, scCaretX);
|
||||
if FCaret.OldLinePos <> FCaret.LinePos then begin
|
||||
if FCaret.OldLinePos <> FCaret.LinePos then
|
||||
Include(fStatusChanges, scCaretY);
|
||||
if (FCaret.OldViewedLineCharPos.Y < 0) or
|
||||
(FCaret.OldViewedLineCharPos.Y <> FCaret.ViewedLineCharPos.y)
|
||||
then begin
|
||||
InvalidateGutterLines(FCaret.OldLinePos, FCaret.OldLinePos);
|
||||
InvalidateGutterLines(FCaret.LinePos, FCaret.LinePos);
|
||||
end;
|
||||
|
||||
@ -332,6 +332,7 @@ type
|
||||
|
||||
FOldLinePos: Integer; // 1 based
|
||||
FOldCharPos: Integer; // 1 based
|
||||
FOldViewedLineCharPos: TPoint;
|
||||
|
||||
FAdjustToNextChar: Boolean;
|
||||
FMaxLeftChar: TMaxLeftCharFunc;
|
||||
@ -389,6 +390,7 @@ type
|
||||
property OldLineCharPos: TPoint read GetOldLineCharPos;
|
||||
property OldLineBytePos: TPoint read GetOldLineBytePos;
|
||||
property OldFullLogicalPos: TLogCaretPoint read GetOldFullLogicalPos;
|
||||
property OldViewedLineCharPos: TPoint read FOldViewedLineCharPos;
|
||||
|
||||
property AdjustToNextChar: Boolean read FAdjustToNextChar write FAdjustToNextChar; deprecated;
|
||||
property SkipTabs: Boolean read FSkipTabs write SetSkipTabs;
|
||||
@ -1108,6 +1110,13 @@ begin
|
||||
//ValidateBytePos;
|
||||
FOldCharPos := FCharPos;
|
||||
FOldLinePos := FLinePos;
|
||||
if scViewedPosValid in FFlags then begin
|
||||
FOldViewedLineCharPos := FViewedLineCharPos;
|
||||
end
|
||||
else begin
|
||||
FOldViewedLineCharPos.x := -1;
|
||||
FOldViewedLineCharPos.y := -1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSynEditCaret.DoUnlock;
|
||||
@ -1125,6 +1134,13 @@ begin
|
||||
FTouched := False;
|
||||
FOldCharPos := FCharPos;
|
||||
FOldLinePos := FLinePos;
|
||||
if scViewedPosValid in FFlags then begin
|
||||
FOldViewedLineCharPos := FViewedLineCharPos;
|
||||
end
|
||||
else begin
|
||||
FOldViewedLineCharPos.x := -1;
|
||||
FOldViewedLineCharPos.y := -1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSynEditCaret.SetLines(const AValue: TSynEditStringsLinked);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user