From b6cb95b534ced2f70bd122432e24583600b51577 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 11 Dec 2020 09:34:21 -0800 Subject: [PATCH] ui: make F key keep working, fixing breakage in 1.20 (#1411) This seems to be fallout from #1340's 2020-09-16 d0d39e615 lib,cli,ui,web: Introduce ReportSpec, which holds ReportOpts, the day of the report, and the parsed Query. --- hledger-ui/Hledger/UI/AccountsScreen.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index 559d97ab8..a60821a4c 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -53,11 +53,11 @@ accountsScreen = AccountsScreen{ asInit :: Day -> Bool -> UIState -> UIState asInit d reset ui@UIState{ - aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}}, + aopts=UIOpts{cliopts_=CliOpts{reportspec_=rspec@ReportSpec{rsOpts=ropts}}}, ajournal=j, aScreen=s@AccountsScreen{} } = - ui{aopts=uopts', aScreen=s & asList .~ newitems'} + ui{aScreen=s & asList .~ newitems'} where newitems = list AccountsList (V.fromList $ displayitems ++ blankitems) 1 @@ -80,7 +80,7 @@ asInit d reset ui@UIState{ where as = map asItemAccountName displayitems - uopts' = uopts{cliopts_=copts{reportspec_=rspec'}} + -- Further restrict the query based on the current period and future/forecast mode. rspec' = rspec{rsQuery=simplifyQuery $ And [rsQuery rspec, periodq, excludeforecastq (forecast_ ropts)]} where periodq = Date $ periodAsDateSpan $ period_ ropts @@ -106,7 +106,8 @@ asInit d reset ui@UIState{ Mixed amts = normaliseMixedAmountSquashPricesForDisplay $ stripPrices bal stripPrices (Mixed as) = Mixed $ map stripprice as where stripprice a = a{aprice=Nothing} displayitems = map displayitem items - -- blanks added for scrolling control, cf RegisterScreen + -- blanks added for scrolling control, cf RegisterScreen. + -- XXX Ugly. Changing to 0 helps when debugging. blankitems = replicate 100 AccountsScreenItem{asItemIndentLevel = 0 ,asItemAccountName = ""