diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index f86169ab1..20add4b78 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -122,10 +122,10 @@ asInit _ _ _ = error "init function called with wrong screen type, should not ha asDraw :: UIState -> [Widget Name] asDraw UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} - ,ajournal=j - ,aScreen=s@AccountsScreen{} - ,aMode=mode - } = + ,ajournal=j + ,aScreen=s@AccountsScreen{} + ,aMode=mode + } = case mode of Help -> [helpDialog copts, maincontent] -- Minibuffer e -> [minibuffer e, maincontent] diff --git a/hledger-ui/Hledger/UI/ErrorScreen.hs b/hledger-ui/Hledger/UI/ErrorScreen.hs index 4b3c6d275..e70cc615e 100644 --- a/hledger-ui/Hledger/UI/ErrorScreen.hs +++ b/hledger-ui/Hledger/UI/ErrorScreen.hs @@ -46,7 +46,8 @@ esInit _ _ _ = error "init function called with wrong screen type, should not ha esDraw :: UIState -> [Widget Name] esDraw UIState{aopts=UIOpts{cliopts_=copts@CliOpts{}} ,aScreen=ErrorScreen{..} - ,aMode=mode} = + ,aMode=mode + } = case mode of Help -> [helpDialog copts, maincontent] -- Minibuffer e -> [minibuffer e, maincontent] @@ -74,12 +75,12 @@ esDraw UIState{aopts=UIOpts{cliopts_=copts@CliOpts{}} esDraw _ = error "draw function called with wrong screen type, should not happen" esHandle :: UIState -> BrickEvent Name AppEvent -> EventM Name (Next UIState) -esHandle ui@UIState{ - aScreen=ErrorScreen{..} - ,aopts=UIOpts{cliopts_=copts} - ,ajournal=j - ,aMode=mode - } ev = +esHandle ui@UIState{aScreen=ErrorScreen{..} + ,aopts=UIOpts{cliopts_=copts} + ,ajournal=j + ,aMode=mode + } + ev = case mode of Help -> case ev of diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index 9d00b2bba..61d53fdaa 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -133,9 +133,9 @@ rsInit _ _ _ = error "init function called with wrong screen type, should not ha rsDraw :: UIState -> [Widget Name] rsDraw UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} - ,aScreen=RegisterScreen{..} - ,aMode=mode - } = + ,aScreen=RegisterScreen{..} + ,aMode=mode + } = case mode of Help -> [helpDialog copts, maincontent] -- Minibuffer e -> [minibuffer e, maincontent] diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index 35abda23f..69476c140 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -49,11 +49,12 @@ tsInit _ _ _ = error "init function called with wrong screen type, should not ha tsDraw :: UIState -> [Widget Name] tsDraw UIState{aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} - ,aScreen=TransactionScreen{ - tsTransaction=(i,t) - ,tsTransactions=nts - ,tsAccount=acct} - ,aMode=mode} = + ,aScreen=TransactionScreen{tsTransaction=(i,t) + ,tsTransactions=nts + ,tsAccount=acct + } + ,aMode=mode + } = case mode of Help -> [helpDialog copts, maincontent] -- Minibuffer e -> [minibuffer e, maincontent] @@ -106,12 +107,13 @@ tsDraw _ = error "draw function called with wrong screen type, should not happen tsHandle :: UIState -> BrickEvent Name AppEvent -> EventM Name (Next UIState) tsHandle ui@UIState{aScreen=s@TransactionScreen{tsTransaction=(i,t) - ,tsTransactions=nts - ,tsAccount=acct} - ,aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} - ,ajournal=j - ,aMode=mode - } + ,tsTransactions=nts + ,tsAccount=acct + } + ,aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} + ,ajournal=j + ,aMode=mode + } ev = case mode of Help ->