hledger-ui 1.22.1 → 1.22.2
raw patch · 10 files changed
+35/−27 lines, 10 filesdep ~hledgerdep ~hledger-lib
Dependency ranges changed: hledger, hledger-lib
Files
- CHANGES.md +7/−0
- Hledger/UI/AccountsScreen.hs +3/−3
- Hledger/UI/ErrorScreen.hs +4/−4
- Hledger/UI/Main.hs +3/−2
- Hledger/UI/RegisterScreen.hs +3/−3
- Hledger/UI/UIState.hs +6/−6
- hledger-ui.1 +2/−2
- hledger-ui.cabal +4/−4
- hledger-ui.info +1/−1
- hledger-ui.txt +2/−2
CHANGES.md view
@@ -9,9 +9,16 @@ User-visible changes in hledger-ui. See also the hledger changelog. +# 1.22.2 2021-08-07++- Use hledger 1.22.2.+ # 1.22.1 2021-08-02 Improvements++- Document watch mode and its limitations.+ (#1617, #911, #836) - Allow megaparsec 9.1.
Hledger/UI/AccountsScreen.hs view
@@ -49,7 +49,7 @@ asInit :: Day -> Bool -> UIState -> UIState asInit d reset ui@UIState{- aopts=UIOpts{cliopts_=CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}},+ aopts=UIOpts{cliopts_=copts@CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}}, ajournal=j, aScreen=s@AccountsScreen{} } =@@ -77,7 +77,7 @@ as = map asItemAccountName displayitems -- Further restrict the query based on the current period and future/forecast mode.- rspec' = rspec{rsQuery=simplifyQuery $ And [rsQuery rspec, periodq, excludeforecastq (forecast_ ropts)]}+ rspec' = rspec{rsQuery=simplifyQuery $ And [rsQuery rspec, periodq, excludeforecastq (forecast_ $ inputopts_ copts)]} where periodq = Date $ periodAsDateSpan $ period_ ropts -- Except in forecast mode, exclude future/forecast transactions.@@ -198,7 +198,7 @@ -- ,("l", str "list") ,("-+", str "depth") ,("H", renderToggle (not ishistorical) "end-bals" "changes")- ,("F", renderToggle1 (isJust $ forecast_ ropts) "forecast")+ ,("F", renderToggle1 (isJust . forecast_ $ inputopts_ copts) "forecast") --,("/", "filter") --,("DEL", "unfilter") --,("ESC", "cancel/top")
Hledger/UI/ErrorScreen.hs view
@@ -182,13 +182,13 @@ -- or in the provided UIState's startup options, -- it is preserved. enableForecastPreservingPeriod :: UIState -> CliOpts -> CliOpts-enableForecastPreservingPeriod ui copts@CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}} =- copts{reportspec_=rspec{rsOpts=ropts{forecast_=mforecast}}}+enableForecastPreservingPeriod ui copts@CliOpts{inputopts_=iopts} =+ copts{inputopts_=iopts{forecast_=mforecast}} where mforecast = asum [mprovidedforecastperiod, mstartupforecastperiod, mdefaultforecastperiod] where- mprovidedforecastperiod = forecast_ ropts- mstartupforecastperiod = forecast_ $ rsOpts $ reportspec_ $ cliopts_ $ astartupopts ui+ mprovidedforecastperiod = forecast_ $ inputopts_ copts+ mstartupforecastperiod = forecast_ $ inputopts_ $ cliopts_ $ astartupopts ui mdefaultforecastperiod = Just nulldatespan -- Re-check any balance assertions in the current journal, and if any
Hledger/UI/Main.hs view
@@ -8,6 +8,7 @@ module Hledger.UI.Main where +import Control.Applicative ((<|>)) import Control.Concurrent (threadDelay) import Control.Concurrent.Async (withAsync) import Control.Monad (forM_, void, when)@@ -43,11 +44,11 @@ main :: IO () main = do- opts@UIOpts{cliopts_=copts@CliOpts{inputopts_=_iopts,reportspec_=rspec@ReportSpec{rsOpts=ropts},rawopts_=rawopts}} <- getHledgerUIOpts+ opts@UIOpts{cliopts_=copts@CliOpts{inputopts_=iopts,rawopts_=rawopts}} <- getHledgerUIOpts -- when (debug_ $ cliopts_ opts) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show opts) -- always generate forecasted periodic transactions; their visibility will be toggled by the UI.- let copts' = copts{reportspec_=rspec{rsOpts=ropts{forecast_=Just $ fromMaybe nulldatespan (forecast_ ropts)}}}+ let copts' = copts{inputopts_=iopts{forecast_=forecast_ iopts <|> Just nulldatespan}} case True of _ | "help" `inRawOpts` rawopts -> putStr (showModeUsage uimode)
Hledger/UI/RegisterScreen.hs view
@@ -56,7 +56,7 @@ rsSetAccount _ _ scr = scr rsInit :: Day -> Bool -> UIState -> UIState-rsInit d reset ui@UIState{aopts=_uopts@UIOpts{cliopts_=CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}}, ajournal=j, aScreen=s@RegisterScreen{..}} =+rsInit d reset ui@UIState{aopts=_uopts@UIOpts{cliopts_=CliOpts{inputopts_=iopts,reportspec_=rspec@ReportSpec{rsOpts=ropts}}}, ajournal=j, aScreen=s@RegisterScreen{..}} = ui{aScreen=s{rsList=newitems'}} where -- gather arguments and queries@@ -77,7 +77,7 @@ updateReportSpec ropts' rspec -- Further restrict the query based on the current period and future/forecast mode.- q = simplifyQuery $ And [rsQuery rspec', periodq, excludeforecastq (forecast_ ropts)]+ q = simplifyQuery $ And [rsQuery rspec', periodq, excludeforecastq (forecast_ iopts)] where periodq = Date $ periodAsDateSpan $ period_ ropts -- Except in forecast mode, exclude future/forecast transactions.@@ -251,7 +251,7 @@ -- ,("l", str "list(-subs)") ,("H", renderToggle (not ishistorical) "historical" "period")- ,("F", renderToggle1 (isJust $ forecast_ ropts) "forecast")+ ,("F", renderToggle1 (isJust . forecast_ . inputopts_ $ copts) "forecast") -- ,("a", "add") -- ,("g", "reload") -- ,("q", "quit")
Hledger/UI/UIState.hs view
@@ -7,8 +7,8 @@ where import Brick.Widgets.Edit+import Control.Applicative ((<|>)) import Data.List ((\\), foldl', sort)-import Data.Maybe (fromMaybe) import Data.Semigroup (Max(..)) import qualified Data.Text as T import Data.Text.Zipper (gotoEOL)@@ -157,19 +157,19 @@ -- (which are usually but not necessarily future-dated). -- In normal mode, both of these are hidden. toggleForecast :: Day -> UIState -> UIState-toggleForecast d ui@UIState{aopts=UIOpts{cliopts_=copts@CliOpts{reportspec_=ReportSpec{rsOpts=ropts}}}} =+toggleForecast d ui@UIState{aopts=UIOpts{cliopts_=copts@CliOpts{inputopts_=iopts}}} = uiSetForecast ui $- case forecast_ ropts of+ case forecast_ iopts of Just _ -> Nothing- Nothing -> Just $ fromMaybe nulldatespan $ forecastPeriodFromRawOpts d $ rawopts_ copts+ Nothing -> forecastPeriodFromRawOpts d (rawopts_ copts) <|> Just nulldatespan -- | Helper: set forecast mode (with the given forecast period) on or off in the UI state. uiSetForecast :: UIState -> Maybe DateSpan -> UIState uiSetForecast- ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}}}+ ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=iopts}}} mforecast = -- we assume forecast mode has no effect on ReportSpec's derived fields- ui{aopts=uopts{cliopts_=copts{reportspec_=rspec{rsOpts=ropts{forecast_=mforecast}}}}}+ ui{aopts=uopts{cliopts_=copts{inputopts_=iopts{forecast_=mforecast}}}} -- | Toggle between showing all and showing only real (non-virtual) items. toggleReal :: UIState -> UIState
hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "HLEDGER-UI" "1" "August 2021" "hledger-ui-1.22.1 " "hledger User Manuals"+.TH "HLEDGER-UI" "1" "August 2021" "hledger-ui-1.22.2 " "hledger User Manuals" @@ -7,7 +7,7 @@ .PP hledger-ui is a terminal interface (TUI) for the hledger accounting tool.-This manual is for hledger-ui 1.22.1.+This manual is for hledger-ui 1.22.2. .SH SYNOPSIS .PP \f[C]hledger-ui [OPTIONS] [QUERYARGS]\f[R]
hledger-ui.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hledger-ui-version: 1.22.1+version: 1.22.2 synopsis: Curses-style terminal interface for the hledger accounting system description: A simple curses-style terminal user interface for the hledger accounting system. It can be a more convenient way to browse your accounts than the CLI.@@ -63,7 +63,7 @@ hs-source-dirs: ./ ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans- cpp-options: -DVERSION="1.22.1"+ cpp-options: -DVERSION="1.22.2" build-depends: ansi-terminal >=0.9 , async@@ -77,8 +77,8 @@ , extra >=1.6.3 , filepath , fsnotify >=0.2.1.2 && <0.4- , hledger >=1.22.1 && <1.23- , hledger-lib >=1.22.1 && <1.23+ , hledger >=1.22.2 && <1.23+ , hledger-lib >=1.22.2 && <1.23 , megaparsec >=7.0.0 && <9.2 , microlens >=0.4 , microlens-platform >=0.2.3.1
hledger-ui.info view
@@ -12,7 +12,7 @@ ************* hledger-ui is a terminal interface (TUI) for the hledger accounting-tool. This manual is for hledger-ui 1.22.1.+tool. This manual is for hledger-ui 1.22.2. 'hledger-ui [OPTIONS] [QUERYARGS]' 'hledger ui -- [OPTIONS] [QUERYARGS]'
hledger-ui.txt view
@@ -5,7 +5,7 @@ NAME hledger-ui is a terminal interface (TUI) for the hledger accounting- tool. This manual is for hledger-ui 1.22.1.+ tool. This manual is for hledger-ui 1.22.2. SYNOPSIS hledger-ui [OPTIONS] [QUERYARGS]@@ -504,4 +504,4 @@ -hledger-ui-1.22.1 August 2021 HLEDGER-UI(1)+hledger-ui-1.22.2 August 2021 HLEDGER-UI(1)