brick 0.41.2 → 0.41.3
raw patch · 4 files changed
+19/−5 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Brick.BorderMap: eBottomL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.BorderMap: eBottomL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.BorderMap: eLeftL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.BorderMap: eLeftL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.BorderMap: eRightL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.BorderMap: eRightL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.BorderMap: eTopL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.BorderMap: eTopL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.Focus: focusRingCursor :: (Eq n) => (a -> FocusRing n) -> a -> [CursorLocation n] -> Maybe (CursorLocation n)
+ Brick.Focus: focusRingCursor :: Eq n => (a -> FocusRing n) -> a -> [CursorLocation n] -> Maybe (CursorLocation n)
- Brick.Focus: focusSetCurrent :: (Eq n) => n -> FocusRing n -> FocusRing n
+ Brick.Focus: focusSetCurrent :: Eq n => n -> FocusRing n -> FocusRing n
- Brick.Forms: FormField :: n -> b -> Maybe a -> Bool -> Bool -> b -> Widget n -> BrickEvent n e -> b -> EventM n b -> FormField a b e n
+ Brick.Forms: FormField :: n -> (b -> Maybe a) -> Bool -> (Bool -> b -> Widget n) -> (BrickEvent n e -> b -> EventM n b) -> FormField a b e n
- Brick.Forms: [FormFieldState] :: {formFieldState :: b The current state value associated with the field collection. Note that this type is existential. All form fields in the collection must validate to this type., formFieldLens :: Lens' s a A lens to extract and store a successfully-validated form input back into your form state., formFields :: [FormField a b e n] The form fields, in order, that the user will interact with to manipulate this state value., formFieldRenderHelper :: Widget n -> Widget n A helper function to augment the rendered representation of this collection of form fields. It receives the default representation and can augment it, for example, by adding a label on the left., formFieldConcat :: [Widget n] -> Widget n Concatenation function for this field's input renderings.} -> FormFieldState s e n
+ Brick.Forms: [FormFieldState] :: {formFieldState :: b " The current state value associated with the field collection. Note that this type is existential. All form fields in the collection must validate to this type.", formFieldLens :: Lens' s a " A lens to extract and store a successfully-validated form input back into your form state.", formFields :: [FormField a b e n] " The form fields, in order, that the user will interact with to manipulate this state value.", formFieldRenderHelper :: Widget n -> Widget n " A helper function to augment the rendered representation of this collection of form fields. It receives the default representation and can augment it, for example, by adding a label on the left.", formFieldConcat :: [Widget n] -> Widget n " Concatenation function for this field's input renderings."} -> FormFieldState s e n
- Brick.Forms: handleFormEvent :: (Eq n) => BrickEvent n e -> Form s e n -> EventM n (Form s e n)
+ Brick.Forms: handleFormEvent :: Eq n => BrickEvent n e -> Form s e n -> EventM n (Form s e n)
- Brick.Forms: renderForm :: (Eq n) => Form s e n -> Widget n
+ Brick.Forms: renderForm :: Eq n => Form s e n -> Widget n
- Brick.Forms: renderFormFieldState :: (Eq n) => FocusRing n -> FormFieldState s e n -> Widget n
+ Brick.Forms: renderFormFieldState :: Eq n => FocusRing n -> FormFieldState s e n -> Widget n
- Brick.Forms: setFieldValid :: (Eq n) => Bool -> n -> Form s e n -> Form s e n
+ Brick.Forms: setFieldValid :: Eq n => Bool -> n -> Form s e n -> Form s e n
- Brick.Main: App :: s -> [Widget n] -> s -> [CursorLocation n] -> Maybe (CursorLocation n) -> s -> BrickEvent n e -> EventM n (Next s) -> s -> EventM n s -> s -> AttrMap -> App s e n
+ Brick.Main: App :: (s -> [Widget n]) -> (s -> [CursorLocation n] -> Maybe (CursorLocation n)) -> (s -> BrickEvent n e -> EventM n (Next s)) -> (s -> EventM n s) -> (s -> AttrMap) -> App s e n
- Brick.Main: customMain :: (Ord n) => IO Vty -> Maybe (BChan e) -> App s e n -> s -> IO s
+ Brick.Main: customMain :: Ord n => IO Vty -> Maybe (BChan e) -> App s e n -> s -> IO s
- Brick.Main: defaultMain :: (Ord n) => App s e n -> s -> IO s
+ Brick.Main: defaultMain :: Ord n => App s e n -> s -> IO s
- Brick.Main: invalidateCache :: (Ord n) => EventM n ()
+ Brick.Main: invalidateCache :: Ord n => EventM n ()
- Brick.Main: invalidateCacheEntry :: (Ord n) => n -> EventM n ()
+ Brick.Main: invalidateCacheEntry :: Ord n => n -> EventM n ()
- Brick.Main: lookupExtent :: (Eq n) => n -> EventM n (Maybe (Extent n))
+ Brick.Main: lookupExtent :: Eq n => n -> EventM n (Maybe (Extent n))
- Brick.Main: lookupViewport :: (Ord n) => n -> EventM n (Maybe Viewport)
+ Brick.Main: lookupViewport :: Ord n => n -> EventM n (Maybe Viewport)
- Brick.Main: showCursorNamed :: (Eq n) => n -> [CursorLocation n] -> Maybe (CursorLocation n)
+ Brick.Main: showCursorNamed :: Eq n => n -> [CursorLocation n] -> Maybe (CursorLocation n)
- Brick.Main: simpleMain :: (Ord n) => Widget n -> IO ()
+ Brick.Main: simpleMain :: Ord n => Widget n -> IO ()
- Brick.Types: CursorLocation :: !Location -> !(Maybe n) -> CursorLocation n
+ Brick.Types: CursorLocation :: !Location -> !Maybe n -> CursorLocation n
- Brick.Types: MouseUp :: n -> (Maybe Button) -> Location -> BrickEvent n e
+ Brick.Types: MouseUp :: n -> Maybe Button -> Location -> BrickEvent n e
- Brick.Types: [cursorLocationName] :: CursorLocation n -> !(Maybe n)
+ Brick.Types: [cursorLocationName] :: CursorLocation n -> !Maybe n
- Brick.Types: bordersL :: forall n_aEmz. Lens' (Result n_aEmz) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n_aEv7. Lens' (Result n_aEv7) (BorderMap DynBorder)
- Brick.Types: cursorLocationL :: forall n_aD2H. Lens' (CursorLocation n_aD2H) Location
+ Brick.Types: cursorLocationL :: forall n_aD9F. Lens' (CursorLocation n_aD9F) Location
- Brick.Types: cursorLocationNameL :: forall n_aD2H n_aEYx. Lens (CursorLocation n_aD2H) (CursorLocation n_aEYx) (Maybe n_aD2H) (Maybe n_aEYx)
+ Brick.Types: cursorLocationNameL :: forall n_aD9F n_aF8j. Lens (CursorLocation n_aD9F) (CursorLocation n_aF8j) (Maybe n_aD9F) (Maybe n_aF8j)
- Brick.Types: cursorsL :: forall n_aEmz. Lens' (Result n_aEmz) [CursorLocation n_aEmz]
+ Brick.Types: cursorsL :: forall n_aEv7. Lens' (Result n_aEv7) [CursorLocation n_aEv7]
- Brick.Types: eBottomL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.Types: eBottomL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.Types: eLeftL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.Types: eLeftL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.Types: eRightL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.Types: eRightL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.Types: eTopL :: forall a_aigY. Lens' (Edges a_aigY) a_aigY
+ Brick.Types: eTopL :: forall a_ahRL. Lens' (Edges a_ahRL) a_ahRL
- Brick.Types: extentsL :: forall n_aEmz. Lens' (Result n_aEmz) [Extent n_aEmz]
+ Brick.Types: extentsL :: forall n_aEv7. Lens' (Result n_aEv7) [Extent n_aEv7]
- Brick.Types: imageL :: forall n_aEmz. Lens' (Result n_aEmz) Image
+ Brick.Types: imageL :: forall n_aEv7. Lens' (Result n_aEv7) Image
- Brick.Types: visibilityRequestsL :: forall n_aEmz. Lens' (Result n_aEmz) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_aEv7. Lens' (Result n_aEv7) [VisibilityRequest]
- Brick.Util: clamp :: (Ord a) => a -> a -> a -> a
+ Brick.Util: clamp :: Ord a => a -> a -> a -> a
- Brick.Widgets.Core: cached :: (Ord n) => n -> Widget n -> Widget n
+ Brick.Widgets.Core: cached :: Ord n => n -> Widget n -> Widget n
- Brick.Widgets.Core: unsafeLookupViewport :: (Ord n) => n -> RenderM n (Maybe Viewport)
+ Brick.Widgets.Core: unsafeLookupViewport :: Ord n => n -> RenderM n (Maybe Viewport)
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1cHQ a_a1cIx. Lens (Dialog a_a1cHQ) (Dialog a_a1cIx) [(String, a_a1cHQ)] [(String, a_a1cIx)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1et8 a_a1etP. Lens (Dialog a_a1et8) (Dialog a_a1etP) [(String, a_a1et8)] [(String, a_a1etP)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1cHQ. Lens' (Dialog a_a1cHQ) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1et8. Lens' (Dialog a_a1et8) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1cHQ. Lens' (Dialog a_a1cHQ) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a1et8. Lens' (Dialog a_a1et8) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1cHQ. Lens' (Dialog a_a1cHQ) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a1et8. Lens' (Dialog a_a1et8) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a18kL n_a18kM t_a18lv. Lens (Editor t_a18kL n_a18kM) (Editor t_a18lv n_a18kM) (TextZipper t_a18kL) (TextZipper t_a18lv)
+ Brick.Widgets.Edit: editContentsL :: forall t_a19wh n_a19wi t_a19x1. Lens (Editor t_a19wh n_a19wi) (Editor t_a19x1 n_a19wi) (TextZipper t_a19wh) (TextZipper t_a19x1)
- Brick.Widgets.List: handleListEvent :: (Ord n) => Event -> List n e -> EventM n (List n e)
+ Brick.Widgets.List: handleListEvent :: Ord n => Event -> List n e -> EventM n (List n e)
- Brick.Widgets.List: handleListEventVi :: (Ord n) => (Event -> List n e -> EventM n (List n e)) -> Event -> List n e -> EventM n (List n e)
+ Brick.Widgets.List: handleListEventVi :: Ord n => (Event -> List n e -> EventM n (List n e)) -> Event -> List n e -> EventM n (List n e)
- Brick.Widgets.List: listElements :: List n e -> (Vector e)
+ Brick.Widgets.List: listElements :: List n e -> Vector e
- Brick.Widgets.List: listElementsL :: forall n_a1hiX e_a1hiY e_a1hvs. Lens (List n_a1hiX e_a1hiY) (List n_a1hiX e_a1hvs) (Vector e_a1hiY) (Vector e_a1hvs)
+ Brick.Widgets.List: listElementsL :: forall n_a1jqz e_a1jqA e_a1jDr. Lens (List n_a1jqz e_a1jqA) (List n_a1jqz e_a1jDr) (Vector e_a1jqA) (Vector e_a1jDr)
- Brick.Widgets.List: listItemHeightL :: forall n_a1hiX e_a1hiY. Lens' (List n_a1hiX e_a1hiY) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a1jqz e_a1jqA. Lens' (List n_a1jqz e_a1jqA) Int
- Brick.Widgets.List: listMovePageDown :: (Ord n) => List n e -> EventM n (List n e)
+ Brick.Widgets.List: listMovePageDown :: Ord n => List n e -> EventM n (List n e)
- Brick.Widgets.List: listMovePageUp :: (Ord n) => List n e -> EventM n (List n e)
+ Brick.Widgets.List: listMovePageUp :: Ord n => List n e -> EventM n (List n e)
- Brick.Widgets.List: listMoveToElement :: (Eq e) => e -> List n e -> List n e
+ Brick.Widgets.List: listMoveToElement :: Eq e => e -> List n e -> List n e
- Brick.Widgets.List: listNameL :: forall n_a1hiX e_a1hiY n_a1hvt. Lens (List n_a1hiX e_a1hiY) (List n_a1hvt e_a1hiY) n_a1hiX n_a1hvt
+ Brick.Widgets.List: listNameL :: forall n_a1jqz e_a1jqA n_a1jDs. Lens (List n_a1jqz e_a1jqA) (List n_a1jDs e_a1jqA) n_a1jqz n_a1jDs
- Brick.Widgets.List: listSelected :: List n e -> (Maybe Int)
+ Brick.Widgets.List: listSelected :: List n e -> Maybe Int
- Brick.Widgets.List: listSelectedL :: forall n_a1hiX e_a1hiY. Lens' (List n_a1hiX e_a1hiY) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a1jqz e_a1jqA. Lens' (List n_a1jqz e_a1jqA) (Maybe Int)
- Data.Text.Markup: fromText :: (Monoid a) => Text -> Markup a
+ Data.Text.Markup: fromText :: Monoid a => Text -> Markup a
- Data.Text.Markup: markupSet :: (Eq a) => (Int, Int) -> a -> Markup a -> Markup a
+ Data.Text.Markup: markupSet :: Eq a => (Int, Int) -> a -> Markup a -> Markup a
- Data.Text.Markup: markupToList :: (Eq a) => Markup a -> [[(Text, a)]]
+ Data.Text.Markup: markupToList :: Eq a => Markup a -> [[(Text, a)]]
- Data.Text.Markup: toText :: (Eq a) => Markup a -> Text
+ Data.Text.Markup: toText :: Eq a => Markup a -> Text
Files
- CHANGELOG.md +12/−0
- README.md +1/−2
- brick.cabal +2/−2
- src/Brick/Widgets/List.hs +4/−1
CHANGELOG.md view
@@ -2,6 +2,18 @@ Brick changelog --------------- +0.41.3+------++Bug fixes:+ * Lists now draw correctly without crashing due to a vector slice+ bounds check failure if their rendering area is too small (#195;+ thanks @andrevdm)++Other changes:+ * Relaxed base bounds to support GHC 8.6 (thanks @maoe)+ * Added towerHanoi to the featured projects list+ 0.41.2 ------
README.md view
@@ -1,7 +1,5 @@  -[](https://travis-ci.org/jtdaugherty/brick)- `brick` is a Haskell terminal user interface programming library in the style of [gloss](http://hackage.haskell.org/package/gloss). This means you write a function that describes how your user interface should look,@@ -68,6 +66,7 @@ * `2048Haskell`, an implementation of the 2048 game: https://github.com/8Gitbrix/2048Haskell * `bhoogle`, a [Hoogle](https://www.haskell.org/hoogle/) client: https://github.com/andrevdm/bhoogle * `clifm`, a file manager: https://github.com/pasqu4le/clifm+ * `towerHanoi`, animated solutions to The Tower of Hanoi: https://github.com/shajenM/projects/tree/master/towerHanoi Getting Started ---------------
brick.cabal view
@@ -1,5 +1,5 @@ name: brick-version: 0.41.2+version: 0.41.3 synopsis: A declarative terminal user interface library description: Write terminal applications painlessly with 'brick'! You write an@@ -86,7 +86,7 @@ Brick.Types.Internal Brick.Widgets.Internal - build-depends: base <= 4.11.1.0,+ build-depends: base <= 4.12.0.0, vty >= 5.24, transformers, data-clist >= 0.1,
src/Brick/Widgets/List.hs view
@@ -208,7 +208,10 @@ Widget Greedy Greedy $ do c <- getContext - let es = V.slice start num (l^.listElementsL)+ let es = if num <= 0+ then V.empty+ else V.slice start num (l^.listElementsL)+ idx = fromMaybe 0 (l^.listSelectedL) start = max 0 $ idx - numPerHeight + 1