diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index ece951f23..c72cf1c8f 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -205,6 +205,7 @@ drawAccountsItem (acctwidth, balwidth) selected (indent, _fullacct, displayacct, handleAccountsScreen :: AppState -> Vty.Event -> EventM (Next AppState) handleAccountsScreen st@AppState{ aScreen=scr@AccountsScreen{asState=(l,selacct)} + ,aopts=UIOpts{cliopts_=copts} ,ajournal=j } e = do d <- liftIO getCurrentDay @@ -226,7 +227,7 @@ handleAccountsScreen st@AppState{ -- Vty.EvKey (Vty.KChar 'l') [Vty.MCtrl] -> do Vty.EvKey (Vty.KChar 'g') [] -> do - ej <- liftIO $ journalReload j -- (ej, changed) <- liftIO $ journalReloadIfChanged copts j + (ej, _) <- liftIO $ journalReloadIfChanged copts d j case ej of Right j' -> continue $ reload j' d st' Left err -> continue $ screenEnter d ES.screen{esState=err} st' diff --git a/hledger-ui/Hledger/UI/ErrorScreen.hs b/hledger-ui/Hledger/UI/ErrorScreen.hs index 8a51071c7..02de808aa 100644 --- a/hledger-ui/Hledger/UI/ErrorScreen.hs +++ b/hledger-ui/Hledger/UI/ErrorScreen.hs @@ -100,7 +100,7 @@ drawErrorScreen _ = error "draw function called with wrong screen type, should n handleErrorScreen :: AppState -> Vty.Event -> EventM (Next AppState) handleErrorScreen st@AppState{ aScreen=s@ErrorScreen{esState=_err} - ,aopts=UIOpts{cliopts_=_copts} + ,aopts=UIOpts{cliopts_=copts} ,ajournal=j } e = do case e of @@ -109,7 +109,7 @@ handleErrorScreen st@AppState{ Vty.EvKey (Vty.KChar 'g') [] -> do d <- liftIO getCurrentDay - ej <- liftIO $ journalReload j -- (ej, changed) <- liftIO $ journalReloadIfChanged copts j + (ej, _) <- liftIO $ journalReloadIfChanged copts d j case ej of Left err -> continue st{aScreen=s{esState=err}} -- show latest parse error Right j' -> continue $ reload j' d $ popScreen st -- return to previous screen, and reload it diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index ce5adcdb8..c1b0aed73 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -189,7 +189,7 @@ drawRegisterItem (datewidth,descwidth,acctswidth,changewidth,balwidth) selected handleRegisterScreen :: AppState -> Vty.Event -> EventM (Next AppState) handleRegisterScreen st@AppState{ aScreen=s@RegisterScreen{rsState=(l,acct)} - ,aopts=UIOpts{cliopts_=_copts} + ,aopts=UIOpts{cliopts_=copts} ,ajournal=j } e = do d <- liftIO getCurrentDay @@ -198,7 +198,7 @@ handleRegisterScreen st@AppState{ Vty.EvKey (Vty.KChar 'q') [] -> halt st Vty.EvKey (Vty.KChar 'g') [] -> do - ej <- liftIO $ journalReload j -- (ej, changed) <- liftIO $ journalReloadIfChanged copts j + (ej, _) <- liftIO $ journalReloadIfChanged copts d j case ej of Right j' -> continue $ reload j' d st Left err -> continue $ screenEnter d ES.screen{esState=err} st diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index 80361249b..48979c83c 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -71,7 +71,7 @@ drawTransactionScreen _ = error "draw function called with wrong screen type, sh handleTransactionScreen :: AppState -> Vty.Event -> EventM (Next AppState) handleTransactionScreen st@AppState{ aScreen=s@TransactionScreen{tsState=((i,t),nts,acct)} - ,aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} + ,aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} ,ajournal=j } e = do d <- liftIO getCurrentDay @@ -84,7 +84,7 @@ handleTransactionScreen st@AppState{ Vty.EvKey (Vty.KChar 'g') [] -> do d <- liftIO getCurrentDay - ej <- liftIO $ journalReload j -- (ej, changed) <- liftIO $ journalReloadIfChanged copts j + (ej, _) <- liftIO $ journalReloadIfChanged copts d j case ej of Right j' -> do -- got to redo the register screen's transactions report, to get the latest transactions list for this screen