diff --git a/src/Brick/Widgets/List.hs b/src/Brick/Widgets/List.hs index 92c73c8..4cf31ae 100644 --- a/src/Brick/Widgets/List.hs +++ b/src/Brick/Widgets/List.hs @@ -193,7 +193,7 @@ listRemove pos l | V.null (l^.listElementsL) = l -- | Replace the contents of a list with a new set of elements and -- update the new selected index. If the specified selected index (via -- 'Just') is not in the list bounds, zero is used instead. -listReplace :: Eq e => V.Vector e -> Maybe Int -> List e -> List e +listReplace :: V.Vector e -> Maybe Int -> List e -> List e listReplace es idx l = let newSel = clamp 0 (V.length es - 1) <$> idx in l & listSelectedL .~ newSel