Skip to content

Commit f4e520c

Browse files
committed
Fix help string for modes
1 parent f13d3e3 commit f4e520c

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

ff-brick/Main.hs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,19 @@ appDraw Model{visibleNotes, openNoteM} = [mainWidget <=> keysHelpLine]
173173
& withBorderIf (focusedWidget == OpenNoteViewport)
174174

175175
keysHelpLine =
176-
withAttr highlightAttr (txt "^q")
177-
<+> txt " "
178-
<+> withAttr highlightAttr (txt "Esc")
179-
<+> txt " exit "
180-
<+> withAttr highlightAttr (txt "Enter")
181-
<+> txt " open"
176+
case focusedWidget of
177+
NoteList ->
178+
withAttr highlightAttr (txt "^q")
179+
<+> txt " "
180+
<+> withAttr highlightAttr (txt "Esc")
181+
<+> txt " exit "
182+
<+> withAttr highlightAttr (txt "Enter")
183+
<+> txt " open"
184+
OpenNoteViewport ->
185+
withAttr highlightAttr (txt "^q")
186+
<+> txt " exit "
187+
<+> withAttr highlightAttr (txt "Esc")
188+
<+> txt " close"
182189

183190
highlightAttr :: AttrName
184191
highlightAttr = attrName "highlight"
@@ -198,8 +205,8 @@ appHandleVtyEvent event = do
198205
case focusedWidget of
199206
NoteList ->
200207
case event of
201-
EvKey KEsc [] -> halt
202208
EvKey (KChar 'q') [MCtrl] -> halt
209+
EvKey KEsc [] -> halt
203210
EvKey KEnter [] -> do
204211
-- open selected note
205212
selectedNoteM <-
@@ -208,10 +215,11 @@ appHandleVtyEvent event = do
208215
e -> zoom #visibleNotes $ handleListEvent e
209216
OpenNoteViewport ->
210217
case event of
218+
EvKey (KChar 'q') [MCtrl] -> halt
211219
EvKey KEsc [] ->
212220
-- close note view
213221
#openNoteM .= Nothing
214-
_ -> pure () -- e -> zoom (#openNoteM . _Just) $ handleViewport e
222+
_ -> pure () -- TODO e -> zoom (#openNoteM . _Just) $ handleViewport e
215223

216224
renderListItem :: Bool -> EntityDoc Note -> Widget
217225
renderListItem _isSelected Entity{entityVal} = txt $ noteTitle entityVal

0 commit comments

Comments
 (0)