From e6d247461b0fd5870771256048666a723b0d911b Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Sat, 4 Nov 2023 14:20:48 +1000 Subject: [PATCH] deps: update to brick-2.1 brick-2.1 brings a new entrypoint that lets us avoid building the vty ourselves. Update to v2.1. --- purebred.cabal | 4 ++-- src/Purebred.hs | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/purebred.cabal b/purebred.cabal index 42581667..c46cda9b 100644 --- a/purebred.cabal +++ b/purebred.cabal @@ -142,9 +142,9 @@ library , deepseq >= 1.4.2 , dyre >= 0.9.1 , lens - , brick >= 1.5 && < 1.11 + , brick >= 2.1 && < 2.2 , text-zipper - , vty >= 5.34 + , vty >= 6 , vector >= 0.12.0.0 , notmuch >= 0.3.1 && < 0.4 , text diff --git a/src/Purebred.hs b/src/Purebred.hs index 7cbc27c2..61b57438 100644 --- a/src/Purebred.hs +++ b/src/Purebred.hs @@ -190,11 +190,10 @@ import Purebred.Storage.Tags (TagOp(..)) import Purebred.Types.Error -- re-exports for configuration -import qualified Graphics.Vty import Graphics.Vty.Attributes import Graphics.Vty.Input.Events (Event(..), Key(..), Modifier(..)) import Brick.BChan (newBChan) -import Brick.Main (customMain) +import Brick.Main (customMainWithDefaultVty) import Brick.Util (on, fg, bg) import Brick.AttrMap (AttrName, applyAttrMappings, attrName) import Control.Lens ((&), _head, ifoldMap, ix, over, preview, set, toListOf, view, views) @@ -304,14 +303,12 @@ launch ghcOpts inCfg = do sink (LT.pack "Opened log file") s <- initialState cfg' bchan server sink - let buildVty = Graphics.Vty.mkVty Graphics.Vty.defaultConfig - initialVty <- buildVty let query = view (confNotmuch . nmHasNewMailSearch) cfg' delay = view (confNotmuch . nmHasNewMailCheckDelay) cfg' maybe (pure ()) (rescheduleMailcheck bchan server query) delay - void $ customMain initialVty buildVty (Just bchan) (theApp s) s + void $ customMainWithDefaultVty (Just bchan) (theApp s) s -- | Main program entry point. Apply to a list of plugins (use