diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index 76cc9c336..c1fb52194 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -106,6 +106,7 @@ drawAccountsScreen AppState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} [ui] where toplabel = files + <+> nonzero <+> str " accounts" <+> borderQueryStr querystr <+> togglefilters @@ -129,6 +130,8 @@ drawAccountsScreen AppState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} ] of [] -> str "" fs -> str " with " <+> withAttr (borderAttr <> "query") (str $ intercalate ", " fs) <+> str " txns" + nonzero | empty_ ropts = str "" + | otherwise = withAttr (borderAttr <> "query") (str " nonzero") cur = str (case l^.listSelectedL of Nothing -> "-" Just i -> show (i + 1)) @@ -138,7 +141,7 @@ drawAccountsScreen AppState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} -- ("up/down/pgup/pgdown/home/end", "move") ("-=1234567890", "depth") ,("F", "flat?") - ,("E", "empty?") + ,("E", "nonzero?") ,("C", "cleared?") ,("R", "real?") ,("right/enter", "register") diff --git a/hledger-ui/Hledger/UI/Main.hs b/hledger-ui/Hledger/UI/Main.hs index aaa73de3e..dec964b38 100644 --- a/hledger-ui/Hledger/UI/Main.hs +++ b/hledger-ui/Hledger/UI/Main.hs @@ -79,7 +79,9 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do depth_=depthfromoptsandargs, -- remove depth: args from query_ query_=unwords $ -- as in ReportOptions, with same limitations - [v | (k,v) <- rawopts_ copts, k=="args", not $ "depth" `isPrefixOf` v] + [v | (k,v) <- rawopts_ copts, k=="args", not $ "depth" `isPrefixOf` v], + -- show items with zero amount by default, unlike the CLI + empty_=True } } } diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index 0e760ea48..4dcea85b1 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -104,6 +104,7 @@ drawRegisterScreen AppState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} case concat [ if cleared_ ropts then ["cleared"] else [] ,if real_ ropts then ["real"] else [] + ,if empty_ ropts then [] else ["nonzero"] ] of [] -> str "" fs -> withAttr (borderAttr <> "query") (str $ " " ++ intercalate ", " fs)