diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index 8ca13b59d..c8f6e1a11 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -286,7 +286,7 @@ asHandle ui0@UIState{ Help -> case ev of - VtyEvent (EvKey (KChar 'q') []) -> halt ui + -- VtyEvent (EvKey (KChar 'q') []) -> halt ui VtyEvent (EvKey (KChar 'l') [MCtrl]) -> redraw ui VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui _ -> helpHandle ui ev diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index d93b0a476..c4805256a 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -302,7 +302,7 @@ rsHandle ui@UIState{ Help -> case ev of - VtyEvent (EvKey (KChar 'q') []) -> halt ui + -- VtyEvent (EvKey (KChar 'q') []) -> halt ui VtyEvent (EvKey (KChar 'l') [MCtrl]) -> redraw ui VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui _ -> helpHandle ui ev diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index 154ab4b6c..28ca4de64 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -141,7 +141,7 @@ tsHandle ui@UIState{aScreen=s@TransactionScreen{tsTransaction=(i,t) case mode of Help -> case ev of - VtyEvent (EvKey (KChar 'q') []) -> halt ui + -- VtyEvent (EvKey (KChar 'q') []) -> halt ui VtyEvent (EvKey (KChar 'l') [MCtrl]) -> redraw ui VtyEvent (EvKey (KChar 'z') [MCtrl]) -> suspend ui _ -> helpHandle ui ev diff --git a/hledger-ui/Hledger/UI/UIUtils.hs b/hledger-ui/Hledger/UI/UIUtils.hs index 576435a89..3f849cfa0 100644 --- a/hledger-ui/Hledger/UI/UIUtils.hs +++ b/hledger-ui/Hledger/UI/UIUtils.hs @@ -90,7 +90,7 @@ helpDialog _copts = c <- getContext render $ withDefAttr "help" $ - renderDialog (dialog (Just "Help (?/LEFT/ESC to close)") Nothing (c^.availWidthL)) $ -- (Just (0,[("ok",())])) + renderDialog (dialog (Just "Help (LEFT/ESC/?/q to close help)") Nothing (c^.availWidthL)) $ -- (Just (0,[("ok",())])) padTop (Pad 0) $ padLeft (Pad 1) $ padRight (Pad 1) $ vBox [ hBox [ @@ -102,12 +102,8 @@ helpDialog _copts = ,renderKey ("RIGHT/l/C-f", "") ,str " show account txns, or txn detail" ,renderKey ("LEFT/h/C-b ", "go back") - ,renderKey ("ESC ", "cancel input, or reset UI") - ,str " " - ,withAttr ("help" <> "heading") $ str "Report period" - ,renderKey ("S-DOWN /S-UP ", "shrink/grow period") - ,renderKey ("S-RIGHT/S-LEFT", "next/previous period") - ,renderKey ("T ", "set period to today") + ,renderKey ("ESC ", "cancel or reset") + ,str " " ,withAttr ("help" <> "heading") $ str "Accounts screen" ,renderKey ("1234567890-+ ", "set/adjust depth limit") @@ -118,6 +114,10 @@ helpDialog _copts = ,renderKey ("t ", "toggle subaccount txns\n(and accounts tree/list mode)") ,renderKey ("H ", "toggle historical/period total") ,str " " + ,withAttr ("help" <> "heading") $ str "Help" + ,renderKey ("? ", "toggle this help") + ,renderKey ("p/m/i", "while help is open:\nshow manual in pager/man/info") + ,str " " ] ,padLeft (Pad 1) $ padRight (Pad 0) $ vBox [ @@ -128,11 +128,10 @@ helpDialog _copts = ,renderKey ("R ", "show real/all postings") ,renderKey ("Z ", "show nonzero/all amounts") ,renderKey ("DEL ", "remove filters") + ,renderKey ("S-DOWN /S-UP ", "shrink/grow period") + ,renderKey ("S-RIGHT/S-LEFT", "next/previous period") + ,renderKey ("T ", "set period to today") ,str " " - ,withAttr ("help" <> "heading") $ str "Help" - ,renderKey ("? ", "toggle this help") - ,renderKey ("p/m/i", "(with this help open)\nshow manual in pager/man/info") - -- ,str " " -- need one more line in 80x25 ,withAttr ("help" <> "heading") $ str "Other" ,renderKey ("a ", "add transaction (hledger add)") ,renderKey ("A ", "add transaction (hledger-iadd)") @@ -169,7 +168,9 @@ helpHandle :: UIState -> BrickEvent Name AppEvent -> EventM Name (Next UIState) helpHandle ui ev = do pagerprog <- liftIO $ fromMaybe "less" <$> lookupEnv "PAGER" case ev of - VtyEvent e | e `elem` (moveLeftEvents ++ [EvKey KEsc [], EvKey (KChar '?') []]) -> continue $ setMode Normal ui + VtyEvent e + | e `elem` (moveLeftEvents ++ [EvKey KEsc [], EvKey (KChar '?') [], EvKey (KChar 'q') []]) + -> continue $ setMode Normal ui VtyEvent (EvKey (KChar 'p') []) -> suspendAndResume $ runPagerForTopic pagerprog "hledger-ui" >> return ui' VtyEvent (EvKey (KChar 'm') []) -> suspendAndResume $ runManForTopic "hledger-ui" >> return ui' VtyEvent (EvKey (KChar 'i') []) -> suspendAndResume $ runInfoForTopic "hledger-ui" >> return ui' diff --git a/hledger-ui/hledger-ui.m4.md b/hledger-ui/hledger-ui.m4.md index b67fa921e..a1f8dbad7 100644 --- a/hledger-ui/hledger-ui.m4.md +++ b/hledger-ui/hledger-ui.m4.md @@ -95,7 +95,7 @@ which should contain one command line option/argument per line. `?` shows a help dialog listing all keys. (some of these also appear in the quick help at the bottom of each screen.) -press `?` again (or `escape`, or `left`) to close it. +press `?` again (or `escape`, or `left`, or `q`) to close it. the following keys work on most screens: the cursor keys navigate: