aboutsummaryrefslogtreecommitdiff
path: root/Screen.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-08-27 20:51:22 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-08-27 20:51:22 -0300
commit9367826dae8093008a4c6414dd3bf1c6b90be822 (patch)
tree75b46cec23bce75b6f4ced3b7e9d7afeafa537a3 /Screen.hs
parent32dc8cc98ef0e49e042d7d8cf000dc6360b106d6 (diff)
Empty list case of drawSelectionList
Diffstat (limited to 'Screen.hs')
-rw-r--r--Screen.hs18
1 files changed, 11 insertions, 7 deletions
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"]
nihil fit ex nihilo