From 9367826dae8093008a4c6414dd3bf1c6b90be822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Tue, 27 Aug 2013 20:51:22 -0300 Subject: Empty list case of drawSelectionList --- Screen.hs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Screen.hs') diff --git a/Screen.hs b/Screen.hs index 18a905b..493c9b4 100644 --- a/Screen.hs +++ b/Screen.hs @@ -83,6 +83,8 @@ drawMode MaildirMode = get >>= \st -> drawSelectionList $ detectedMDs . maildirS drawMode IndexMode = get >>= \st -> drawSelectionList $ scrollBufferIn . indexState $ st drawMode EmailMode = drawEmailHelper +{- Draw a scrollable selection list -} +drawSelectionList [] = resetCurrentRow drawSelectionList ((path, str):mds) = do st <- get (=<<) put $ liftUpdate $ do @@ -108,7 +110,7 @@ drawSelectionList ((path, str):mds) = do if currentRow st < limit then do incrementCurrentRow - drawMaildirHelper mds + drawSelectionList mds else resetCurrentRow @@ -166,13 +168,15 @@ drawStatus = do drawString . normalizeLen (screenColumns st) . concat $ drawStatusHelper (mode st) st setColor $ baseColorID . colorStyle $ st -drawStatusHelper MaildirMode st = ["Maildir listing - " - , "(", show ((+ 1) . selectedRow $ st), "/" - , show (length $ detectedMDs . maildirState $ st), ")"] +drawStatusHelper MaildirMode st = + ["Maildir listing - " + , "(", show ((+ 1) . selectedRow $ st), "/" + , show (length $ detectedMDs . maildirState $ st), ")"] -drawStatusHelper IndexMode st = ["mode: Index - " - , "(", show ((selectedRow st) + (scrollRowIn . indexState $ st) + 1), "/" - , show (currentInLen . indexState $ st), ")"] +drawStatusHelper IndexMode st = + ["mode: Index - " + , "(", show ((selectedRow st) + (scrollRowIn . indexState $ st) + 1), "/" + , show (currentInLen . indexState $ st), ")"] drawStatusHelper EmailMode st = ["mode: Email"] -- cgit v1.2.3