aboutsummaryrefslogtreecommitdiff
path: root/State.hs
diff options
context:
space:
mode:
Diffstat (limited to 'State.hs')
-rw-r--r--State.hs58
1 files changed, 30 insertions, 28 deletions
diff --git a/State.hs b/State.hs
index f9623dc..5b91d15 100644
--- a/State.hs
+++ b/State.hs
@@ -101,20 +101,21 @@ curRowAsInteger st = toInteger $ currentRow st
colPadAsInteger st = toInteger $ columnPadding st
-incrementSelectedRow st | (selectedRow st) < limit = case (mode st) of
- MaildirMode ->
- let
- sr = (selectedRowMD . maildirState) st
- maildirState' = (maildirState st) { selectedRowMD = sr + 1 }
- in
- st { maildirState = maildirState' }
- IndexMode ->
- let
- sr = (selectedRowIn . indexState) st
- indexState' = (indexState st) { selectedRowIn = sr + 1 }
- in
- st { indexState = indexState' }
- _ -> st
+incrementSelectedRow st | (selectedRow st) < limit =
+ case (mode st) of
+ MaildirMode ->
+ let
+ sr = (selectedRowMD . maildirState) st
+ maildirState' = (maildirState st) { selectedRowMD = sr + 1 }
+ in
+ st { maildirState = maildirState' }
+ IndexMode ->
+ let
+ sr = (selectedRowIn . indexState) st
+ indexState' = (indexState st) { selectedRowIn = sr + 1 }
+ in
+ st { indexState = indexState' }
+ _ -> st
| otherwise = st
where
limit' = case (mode st) of
@@ -124,20 +125,21 @@ incrementSelectedRow st | (selectedRow st) < limit = case (mode st) of
then fromIntegral $ limit' - 2
else fromIntegral limit'
-decrementSelectedRow st | (selectedRow st) > 0 = case (mode st) of
- MaildirMode ->
- let
- sr = (selectedRowMD . maildirState) st
- maildirState' = (maildirState st) { selectedRowMD = sr - 1 }
- in
- st { maildirState = maildirState' }
- IndexMode ->
- let
- sr = (selectedRowIn . indexState) st
- indexState' = (indexState st) { selectedRowIn = sr - 1 }
- in
- st { indexState = indexState' }
- _ -> st
+decrementSelectedRow st | (selectedRow st) > 0 =
+ case (mode st) of
+ MaildirMode ->
+ let
+ sr = (selectedRowMD . maildirState) st
+ maildirState' = (maildirState st) { selectedRowMD = sr - 1 }
+ in
+ st { maildirState = maildirState' }
+ IndexMode ->
+ let
+ sr = (selectedRowIn . indexState) st
+ indexState' = (indexState st) { selectedRowIn = sr - 1 }
+ in
+ st { indexState = indexState' }
+ _ -> st
| otherwise = st
selectedRow st = case (mode st) of
nihil fit ex nihilo