From 55f42c3d1e2f2028637340b4a1ce94fbb6a964bf Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Thu, 1 Jul 2021 12:50:51 +1000 Subject: [PATCH] ui: Do not reset cost and value flags on reload. --- hledger-ui/Hledger/UI/TransactionScreen.hs | 6 +----- hledger-ui/Hledger/UI/UIState.hs | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index 8995dd06a..da52e1c29 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -173,11 +173,7 @@ tsHandle ui@UIState{aScreen=s@TransactionScreen{tsTransaction=(i,t) ej <- liftIO $ journalReload copts case ej of Left err -> continue $ screenEnter d errorScreen{esError=err} ui - Right j' -> do - continue $ - regenerateScreens j' d $ - clearCostValue $ - ui + Right j' -> continue $ regenerateScreens j' d ui VtyEvent (EvKey (KChar 'I') []) -> continue $ uiCheckBalanceAssertions d (toggleIgnoreBalanceAssertions ui) -- for toggles that may change the current/prev/next transactions, diff --git a/hledger-ui/Hledger/UI/UIState.hs b/hledger-ui/Hledger/UI/UIState.hs index 1e6a02550..561e93ac2 100644 --- a/hledger-ui/Hledger/UI/UIState.hs +++ b/hledger-ui/Hledger/UI/UIState.hs @@ -105,11 +105,6 @@ toggleEmpty ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportspec_=rsp where toggleEmpty ropts = ropts{empty_=not $ empty_ ropts} --- | Show primary amounts, not cost or value. -clearCostValue :: UIState -> UIState -clearCostValue ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}}} = - ui{aopts=uopts{cliopts_=copts{reportspec_=rspec{rsOpts=ropts{cost_ = NoCost, value_ = Nothing}}}}} - -- | Toggle between showing the primary amounts or costs. toggleCost :: UIState -> UIState toggleCost ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}}} =