diff --git a/src/Brick/Widgets/List.hs b/src/Brick/Widgets/List.hs index 4983cf6..de1ce4b 100644 --- a/src/Brick/Widgets/List.hs +++ b/src/Brick/Widgets/List.hs @@ -253,7 +253,7 @@ listMoveToBeginning = listMoveTo 0 listMoveToEnd :: (Foldable t, Splittable t) => GenericList n t e -> GenericList n t e -listMoveToEnd l = listMoveTo (length $ listElements l) l +listMoveToEnd l = listMoveTo (max 0 $ length (listElements l) - 1) l -- | The top-level attribute used for the entire list. listAttr :: AttrName