diff options
Diffstat (limited to 'app/much.hs')
| -rw-r--r-- | app/much.hs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/app/much.hs b/app/much.hs index 84eda6b..fb84186 100644 --- a/app/much.hs +++ b/app/much.hs @@ -1,25 +1,24 @@ -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main (main) where -import Blessings.String.WCWidth import Data.Default import Data.Maybe +import Data.String (fromString) +import Data.Tree qualified as Tree +import Data.Tree.Zipper qualified as Z +import Much.API qualified import Much.Action import Much.Core import Much.State import Much.TreeView +import Notmuch.Message qualified as Notmuch import Scanner import System.Environment (getEnv) import System.IO.Unsafe (unsafePerformIO) import Text.Hyphenation import Text.LineBreak -import qualified Data.Tree as Tree -import qualified Data.Tree.Zipper as Z -import qualified Much.API -import qualified Notmuch.Message as Notmuch scrollLines :: Int @@ -43,6 +42,7 @@ myKeymap :: String -> State -> IO State myKeymap "a" = toggleTagAtCursor "inbox" myKeymap "s" = toggleTagAtCursor "unread" +myKeymap "S" = toggleTagAtCursor "spam" myKeymap "g" = toggleTagAtCursor "killed" myKeymap "f" = toggleTagAtCursor "star" myKeymap "&" = toggleTagAtCursor "killed" @@ -99,13 +99,15 @@ myKeymap "=" = \q@State{..} -> bf = BreakFormat 80 8 shy hyp -- <F1> +myKeymap "\ESCOP" = myKeymap "\ESC[11~" myKeymap "\ESC[11~" = \q@State{..} -> - return q { flashMessage = Plain $ show $ treeViewId $ Z.label cursor } + return q { flashMessage = fromString $ show $ treeViewId $ Z.label cursor } -- <F2> +myKeymap "\ESCOQ" = myKeymap "\ESC[12~" myKeymap "\ESC[12~" = \q@State{..} -> return q { flashMessage = - Plain $ + fromString $ show $ maybe Nothing (Just . Notmuch.messageFilename) $ getMessage $ @@ -113,8 +115,8 @@ myKeymap "\ESC[12~" = \q@State{..} -> } -- TODO Stuff Vim sends after exit (also there is more...) -myKeymap "\ESC[2;2R" = \q -> return q { flashMessage = flashMessage q <> " " <> Plain "stupid" } -myKeymap "\ESC[>85;95;0c" = \q -> return q { flashMessage = flashMessage q <> " " <> Plain "stupid" } +myKeymap "\ESC[2;2R" = \q -> return q { flashMessage = flashMessage q <> " " <> "stupid" } +myKeymap "\ESC[>85;95;0c" = \q -> return q { flashMessage = flashMessage q <> " " <> "stupid" } myKeymap s = displayKey s |
