mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 15:00:26 +02:00
SynEdit: Keep Caret.y (and selection) at 1, even for lines.count = 0
git-svn-id: trunk@61680 -
This commit is contained in:
parent
4c48234762
commit
cc0a2ae11b
@ -2485,8 +2485,8 @@ begin
|
||||
EnsureCursorPosVisible; // TODO: This may call SetTopLine, change order
|
||||
// This does Paintlock, should be before final decrease
|
||||
// Must be after EnsureCursorPosVisible (as it does MoveCaretToVisibleArea)
|
||||
if FCaret.LinePos > FLines.Count then
|
||||
FCaret.LinePos := FLines.Count;
|
||||
if FCaret.LinePos > Max(FLines.Count, 1) then
|
||||
FCaret.LinePos := Max(FLines.Count, 1);
|
||||
if sfCaretChanged in fStateFlags then
|
||||
UpdateCaret;
|
||||
//if sfScrollbarChanged in fStateFlags then
|
||||
|
@ -2280,7 +2280,7 @@ begin
|
||||
if FEnabled then begin
|
||||
FStickyAutoExtend := False;
|
||||
|
||||
Value.y := MinMax(Value.y, 1, fLines.Count);
|
||||
Value.y := MinMax(Value.y, 1, Max(fLines.Count, 1));
|
||||
|
||||
// ensure folded block at bottom line is in selection
|
||||
if (ActiveSelectionMode = smLine) and (FFoldedView <> nil) and
|
||||
|
Loading…
Reference in New Issue
Block a user