mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-10 20:29:50 +01: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
|
EnsureCursorPosVisible; // TODO: This may call SetTopLine, change order
|
||||||
// This does Paintlock, should be before final decrease
|
// 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 FCaret.LinePos > FLines.Count then
|
if FCaret.LinePos > Max(FLines.Count, 1) then
|
||||||
FCaret.LinePos := FLines.Count;
|
FCaret.LinePos := Max(FLines.Count, 1);
|
||||||
if sfCaretChanged in fStateFlags then
|
if sfCaretChanged in fStateFlags then
|
||||||
UpdateCaret;
|
UpdateCaret;
|
||||||
//if sfScrollbarChanged in fStateFlags then
|
//if sfScrollbarChanged in fStateFlags then
|
||||||
|
|||||||
@ -2280,7 +2280,7 @@ begin
|
|||||||
if FEnabled then begin
|
if FEnabled then begin
|
||||||
FStickyAutoExtend := False;
|
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
|
// ensure folded block at bottom line is in selection
|
||||||
if (ActiveSelectionMode = smLine) and (FFoldedView <> nil) and
|
if (ActiveSelectionMode = smLine) and (FFoldedView <> nil) and
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user