mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +03:00
Update brick to 0.19
This commit is contained in:
parent
28c420109d
commit
ffe8b47529
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -10,4 +10,6 @@ packages:
|
||||
- hledger-web
|
||||
- hledger-api
|
||||
|
||||
extra-deps: []
|
||||
extra-deps:
|
||||
- brick-0.19
|
||||
- data-clist-0.1.1.0
|
||||
|
Loading…
Reference in New Issue
Block a user