brick 0.53 → 0.54
raw patch · 5 files changed
+28/−7 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Brick.Widgets.FileBrowser: maybeSelectCurrentEntry :: FileBrowser n -> EventM n (FileBrowser n)
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1htK a_a1hur. Lens (Dialog a_a1htK) (Dialog a_a1hur) [(String, a_a1htK)] [(String, a_a1hur)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1hvC a_a1hwj. Lens (Dialog a_a1hvC) (Dialog a_a1hwj) [(String, a_a1hvC)] [(String, a_a1hwj)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1htK. Lens' (Dialog a_a1htK) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1hvC. Lens' (Dialog a_a1hvC) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1htK. Lens' (Dialog a_a1htK) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a1hvC. Lens' (Dialog a_a1hvC) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1htK. Lens' (Dialog a_a1htK) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a1hvC. Lens' (Dialog a_a1hvC) Int
- Brick.Widgets.FileBrowser: fileBrowserEntryFilterL :: forall n_a1rUh. Lens' (FileBrowser n_a1rUh) (Maybe (FileInfo -> Bool))
+ Brick.Widgets.FileBrowser: fileBrowserEntryFilterL :: forall n_a1rW9. Lens' (FileBrowser n_a1rW9) (Maybe (FileInfo -> Bool))
- Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1rUh. Lens' (FileBrowser n_a1rUh) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1rW9. Lens' (FileBrowser n_a1rW9) (FileInfo -> Bool)
- Brick.Widgets.List: listElementsL :: forall n_a1mxD t_a1mxE e_a1mxF t_a1mMd e_a1mMe. Lens (GenericList n_a1mxD t_a1mxE e_a1mxF) (GenericList n_a1mxD t_a1mMd e_a1mMe) (t_a1mxE e_a1mxF) (t_a1mMd e_a1mMe)
+ Brick.Widgets.List: listElementsL :: forall n_a1mzv t_a1mzw e_a1mzx t_a1mO5 e_a1mO6. Lens (GenericList n_a1mzv t_a1mzw e_a1mzx) (GenericList n_a1mzv t_a1mO5 e_a1mO6) (t_a1mzw e_a1mzx) (t_a1mO5 e_a1mO6)
- Brick.Widgets.List: listItemHeightL :: forall n_a1mxD t_a1mxE e_a1mxF. Lens' (GenericList n_a1mxD t_a1mxE e_a1mxF) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a1mzv t_a1mzw e_a1mzx. Lens' (GenericList n_a1mzv t_a1mzw e_a1mzx) Int
- Brick.Widgets.List: listNameL :: forall n_a1mxD t_a1mxE e_a1mxF n_a1mMf. Lens (GenericList n_a1mxD t_a1mxE e_a1mxF) (GenericList n_a1mMf t_a1mxE e_a1mxF) n_a1mxD n_a1mMf
+ Brick.Widgets.List: listNameL :: forall n_a1mzv t_a1mzw e_a1mzx n_a1mO7. Lens (GenericList n_a1mzv t_a1mzw e_a1mzx) (GenericList n_a1mO7 t_a1mzw e_a1mzx) n_a1mzv n_a1mO7
- Brick.Widgets.List: listSelectedL :: forall n_a1mxD t_a1mxE e_a1mxF. Lens' (GenericList n_a1mxD t_a1mxE e_a1mxF) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a1mzv t_a1mzw e_a1mzx. Lens' (GenericList n_a1mzv t_a1mzw e_a1mzx) (Maybe Int)
Files
- CHANGELOG.md +11/−0
- brick.cabal +1/−1
- src/Brick/Widgets/Core.hs +7/−6
- src/Brick/Widgets/Edit.hs +2/−0
- src/Brick/Widgets/FileBrowser.hs +7/−0
CHANGELOG.md view
@@ -2,6 +2,17 @@ Brick changelog --------------- +0.54+----++API changes:+ * Exported `Brick.Widgets.FileBrowser.maybeSelectCurrentEntry` (thanks+ Róman Joost)++Other changes:+ * Added handlers for the `Home` and `End` keys to+ `Brick.Widgets.Edit.handleEditorEvent` (thanks Róman Joost)+ 0.53 ----
brick.cabal view
@@ -1,5 +1,5 @@ name: brick-version: 0.53+version: 0.54 synopsis: A declarative terminal user interface library description: Write terminal user interfaces (TUIs) painlessly with 'brick'! You
src/Brick/Widgets/Core.hs view
@@ -242,7 +242,7 @@ -- | Make a widget from a string, but wrap the words in the input's -- lines at the available width using the default wrapping settings. The--- input string should not contain escapes.+-- input string should not contain escape sequences or carriage returns. -- -- Unlike 'str', this is greedy horizontally. strWrap :: String -> Widget n@@ -250,7 +250,8 @@ -- | Make a widget from a string, but wrap the words in the input's -- lines at the available width using the specified wrapping settings.--- The input string should not contain escapes.+-- The input string should not contain escape sequences or carriage+-- returns. -- -- Unlike 'str', this is greedy horizontally. strWrapWith :: WrapSettings -> String -> Widget n@@ -261,7 +262,7 @@ -- | Make a widget from text, but wrap the words in the input's lines at -- the available width using the default wrapping settings. The input--- text should not contain escapes.+-- text should not contain escape sequences or carriage returns. -- -- Unlike 'txt', this is greedy horizontally. txtWrap :: T.Text -> Widget n@@ -269,7 +270,7 @@ -- | Make a widget from text, but wrap the words in the input's lines at -- the available width using the specified wrapping settings. The input--- text should not contain escapes.+-- text should not contain escape sequences or carriage returns. -- -- Unlike 'txt', this is greedy horizontally. txtWrapWith :: WrapSettings -> T.Text -> Widget n@@ -296,7 +297,7 @@ -- interface corruption will result since the terminal will likely -- render it as taking up more than a single column. The caller should -- replace tabs with the appropriate number of spaces as desired. The--- reinput string should not contain escapes.+-- input string should not contain escape sequences or carriage returns. str :: String -> Widget n str s = Widget Fixed Fixed $ do@@ -322,7 +323,7 @@ -- interface corruption will result since the terminal will likely -- render it as taking up more than a single column. The caller should -- replace tabs with the appropriate number of spaces as desired. The--- reinput text should not contain escapes.+-- input text should not contain escape sequences or carriage returns. txt :: T.Text -> Widget n txt = str . T.unpack
src/Brick/Widgets/Edit.hs view
@@ -124,6 +124,8 @@ EvKey KLeft [] -> Z.moveLeft EvKey KRight [] -> Z.moveRight EvKey KBS [] -> Z.deletePrevChar+ EvKey KHome [] -> Z.gotoBOL+ EvKey KEnd [] -> Z.gotoEOL _ -> id in return $ applyEdit f ed
src/Brick/Widgets/FileBrowser.hs view
@@ -67,6 +67,7 @@ -- * Handling events , handleFileBrowserEvent+ , maybeSelectCurrentEntry -- * Rendering , renderFileBrowser@@ -631,6 +632,12 @@ _ -> handleEventLensed b fileBrowserEntriesL handleListEvent e +-- | If the browser's current entry is selectable according to+-- @fileBrowserSelectable@, add it to the selection set and return.+-- If not, and if the entry is a directory or a symlink targeting a+-- directory, set the browser's current path to the selected directory.+--+-- Otherwise, return the browser state unchanged. maybeSelectCurrentEntry :: FileBrowser n -> EventM n (FileBrowser n) maybeSelectCurrentEntry b = case fileBrowserCursor b of