From eff6fdb05bd33f6842034f68e8cb4b83503fd5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 30 Sep 2020 17:08:59 +0200 Subject: kmein config: simplify flashMessages --- config/kmein.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/kmein.hs b/config/kmein.hs index 397f1c8..f6f0f04 100644 --- a/config/kmein.hs +++ b/config/kmein.hs @@ -85,13 +85,13 @@ saveAttachment q destination | Just partFileName <- Notmuch.partContentFilename part = attachmentDestination T.unpack partFileName | otherwise = concat ["much_", formatTime defaultTimeLocale "%s" (Notmuch.messageTime message), "_", show (Notmuch.partID part)] - q' = q { flashMessage = SGR [1] (Plain destination) <> Plain " saved." } + q' = q { flashMessage = SGR [1] (Plain destination) <> Plain " saved" } in case Notmuch.partContent part' of Notmuch.ContentText text -> (Just destination, q') <$ T.writeFile destination text Notmuch.ContentRaw raw _ -> (Just destination, q') <$ LBS8.writeFile destination raw - _ -> return (Nothing, q { flashMessage = SGR [38,5,9] $ Plain "This part cannot be saved." }) - Left err -> return (Nothing, q { flashMessage = SGR [38,5,9] $ Plain err }) - | otherwise = return (Nothing, q { flashMessage = SGR [38,5,9] $ Plain "Cursor not on attachment." }) + _ -> return (Nothing, q { flashMessage = "this part cannot be saved" }) + Left err -> return (Nothing, q { flashMessage = Plain err }) + | otherwise = return (Nothing, q { flashMessage = "cursor not on attachment" }) reply :: State -> IO State -- cgit v1.2.3