Update brick to 0.19

This commit is contained in:
Felix Yan 2017-06-27 21:47:54 +08:00 committed by Simon Michael
parent 28c420109d
commit ffe8b47529
6 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{- | UIState operations. -}
{-# LANGUAGE OverloadedStrings #-}
@ -6,7 +7,9 @@
module Hledger.UI.UIState
where
#if !MIN_VERSION_brick(0,19,0)
import Brick
#endif
import Brick.Widgets.Edit
import Data.List
import Data.Text.Zipper (gotoEOL)
@ -235,7 +238,11 @@ getDepth UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}}} = depth_ rop
showMinibuffer :: UIState -> UIState
showMinibuffer ui = setMode (Minibuffer e) ui
where
#if MIN_VERSION_brick(0,19,0)
e = applyEdit gotoEOL $ editor MinibufferEditor (Just 1) oldq
#else
e = applyEdit gotoEOL $ editor MinibufferEditor (str . unlines) (Just 1) oldq
#endif
oldq = query_ $ reportopts_ $ cliopts_ $ aopts ui
-- | Close the minibuffer, discarding any edit in progress.

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{- | Rendering & misc. helpers. -}
{-# LANGUAGE OverloadedStrings #-}
@ -139,7 +140,11 @@ minibuffer :: Editor String Name -> Widget Name
minibuffer ed =
forceAttr (borderAttr <> "minibuffer") $
hBox $
#if MIN_VERSION_brick(0,19,0)
[txt "filter: ", renderEditor (str . unlines) True ed]
#else
[txt "filter: ", renderEditor True ed]
#endif
-- | Wrap a widget in the default hledger-ui screen layout.
defaultLayout :: Widget Name -> Widget Name -> Widget Name -> Widget Name

View File

@ -85,7 +85,7 @@ executable hledger-ui
buildable: False
else
build-depends:
brick >= 0.12 && < 0.19
brick >= 0.12 && < 0.20
, vty >= 5.5 && < 5.16
if flag(threaded)
ghc-options: -threaded

View File

@ -88,7 +88,7 @@ executables:
buildable: false
else:
dependencies:
- brick >= 0.12 && < 0.19
- brick >= 0.12 && < 0.20
- vty >= 5.5 && < 5.16
- condition: flag(threaded)
ghc-options: -threaded

View File

@ -10,7 +10,8 @@ packages:
- hledger-api
extra-deps:
- brick-0.13
- brick-0.19
- data-clist-0.1.1.0
- text-zipper-0.8.1
- vty-5.11.3
- megaparsec-5.1.2

View File

@ -10,4 +10,6 @@ packages:
- hledger-web
- hledger-api
extra-deps: []
extra-deps:
- brick-0.19
- data-clist-0.1.1.0