diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-11-07 12:25:47 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-11-08 17:09:25 +0530 |
| commit | a16933476187a349d619ab29f73dbcae81c8cb24 (patch) | |
| tree | eab12977c61a2c3b9ac88b22637f5511c21f9d18 /lib/Daffm/View.hs | |
| parent | 6c3f7442b92f2fbf2308d93ece448cf3dd759a58 (diff) | |
| download | daffm-a16933476187a349d619ab29f73dbcae81c8cb24.tar.gz daffm-a16933476187a349d619ab29f73dbcae81c8cb24.zip | |
Show error messages (permission error + path not found + invalid command error)
Diffstat (limited to 'lib/Daffm/View.hs')
| -rw-r--r-- | lib/Daffm/View.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Daffm/View.hs b/lib/Daffm/View.hs index da6a11b..0846f66 100644 --- a/lib/Daffm/View.hs +++ b/lib/Daffm/View.hs @@ -18,9 +18,10 @@ import Text.Printf (printf) appView :: AppState -> [Widget FocusTarget] appView appState@(AppState {stateFiles}) = [ui] where - ui = vBox [vLimit 1 header, box, vLimit 1 cmdline] + ui = vBox [vLimit 1 header, box, message, vLimit 1 cmdline] header = headerView appState cmdline = cmdlineView appState + message = messageView appState box = L.renderListWithIndex (fileItemView appState) True stateFiles hFixed :: Int -> Widget n -> Widget n @@ -101,6 +102,10 @@ symTargetView _ Nothing = withAttr invalidLinkAttr $ txt "<none>" symTargetView Nothing (Just target) = withAttr invalidLinkAttr $ txt target symTargetView _ (Just target) = txt target +messageView :: AppState -> Widget FocusTarget +messageView (AppState {stateMessage = Just message}) = txt message +messageView _ = emptyWidget + cmdlineView :: AppState -> Widget FocusTarget cmdlineView (AppState {stateFocusTarget = FocusCmdline, stateCmdlineEditor}) = txt ":" <+> renderEditor (txt . Text.unlines) True stateCmdlineEditor |
