aboutsummaryrefslogtreecommitdiff
path: root/Handlers.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-09-01 11:16:38 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-09-01 11:16:38 -0300
commit39f53d2775f38514a537f03c7b72281ec31a3c0e (patch)
tree42fd07aa22b7ac986b36298b78fe1c9e85ede115 /Handlers.hs
parent58836f3c2020c634a2a508846140d163572fd5c0 (diff)
Further improving on body scrolling
Diffstat (limited to 'Handlers.hs')
-rw-r--r--Handlers.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Handlers.hs b/Handlers.hs
index 4a0ba88..3e27b79 100644
--- a/Handlers.hs
+++ b/Handlers.hs
@@ -86,6 +86,7 @@ incSelectedRow MaildirMode = do
else -- Move the selected row
put $ incrementSelectedRow st
+{- Down-scrolling in Email mode -}
incSelectedRow EmailMode = do
st <- get
let est = emailState st
@@ -94,7 +95,7 @@ incSelectedRow EmailMode = do
let totalRows = length $ emailLines est
let est' = est { scrollRowEm = (cur + 1) }
- when ((totalRows - scrRows) > (scrollRowEm est)) $
+ when ((totalRows - scrRows + (bodyStartRow est) - 1) > (scrollRowEm est)) $
put $ st { emailState = est' }
incSelectedRow _ = (=<<) put $ get >>= \st -> return $ incrementSelectedRow st
@@ -138,7 +139,7 @@ decSelectedRow EmailMode = do
let totalRows = length $ emailLines est
let est' = est { scrollRowEm = (cur - 1) }
- when ((totalRows - (scrRows + cur)) > 0) $
+ when (cur > 0) $
put $ st { emailState = est' }
decSelectedRow _ = (=<<) put $ get >>= \st -> return $ decrementSelectedRow st
@@ -170,6 +171,3 @@ formatMaildirModeRows st = mapM formatRow where
pad = " "
numPads = (length $ filter (== '/') str) + (length $ filter (`elem` imapSep) str)
imapSep = ['.'] -- IMAP usually separates its directories with dots
-
--- TODO: Improve this rancidness
-mailHeaderLength = 4 \ No newline at end of file
nihil fit ex nihilo