mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 16:58:01 +01:00
Merge pull request #1330 from BDisp/listview-move-end-fix
Prevents ListView top to be less than zero if source count is zero.
This commit is contained in:
@@ -557,9 +557,11 @@ namespace Terminal.Gui {
|
||||
/// <returns></returns>
|
||||
public virtual bool MoveEnd ()
|
||||
{
|
||||
if (selected != source.Count - 1) {
|
||||
if (source.Count > 0 && selected != source.Count - 1) {
|
||||
selected = source.Count - 1;
|
||||
top = selected;
|
||||
if (top + selected > Frame.Height - 1) {
|
||||
top = selected;
|
||||
}
|
||||
OnSelectedChanged ();
|
||||
SetNeedsDisplay ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user