aboutsummaryrefslogtreecommitdiff
path: root/State.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-08-25 00:59:04 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-08-25 00:59:04 -0300
commit56dce7c4feada1d4ca93a312e48813fb1918b93b (patch)
tree0b49a6b2c9adefa0d3d6f989a84bfd654f9d1578 /State.hs
parent4728bb04b2f5daff7a2ed8c30dd0fd8a8ee9539b (diff)
advancing in the monads transformers implementation
Diffstat (limited to 'State.hs')
-rw-r--r--State.hs16
1 files changed, 10 insertions, 6 deletions
diff --git a/State.hs b/State.hs
index cb5e426..f4ac3d8 100644
--- a/State.hs
+++ b/State.hs
@@ -89,6 +89,12 @@ initialColorStyle = ColorStyle {
, statusBarColorID = defaultColorID
}
+scrColsAsInteger st = toInteger $ screenColumns st
+scrRowsAsInteger st = toInteger $ screenRows st
+curRowAsInteger st = toInteger $ currentRow st
+colPadAsInteger st = toInteger $ columnPadding st
+
+
{- data MState = MState {
selectedRowMD :: Integer -- Selected row in MaildirMode
@@ -146,11 +152,9 @@ decSelectedRow st | (selectedRow st) > 0 = case (mode st) of
MaildirMode -> st { selectedRowMD = (selectedRowMD st) - 1 }
IndexMode -> st { selectedRowIn = (selectedRowIn st) - 1 }
| otherwise = st
-
+-}
+
selectedRow st = case (mode st) of
- MaildirMode -> selectedRowMD st
- IndexMode -> selectedRowIn st
+ MaildirMode -> selectedRowMD . maildirState $ st
+ IndexMode -> selectedRowIn . indexState $ st
-scrColsAsInt st = fromIntegral $ scrColumns st
-scrRowsAsInt st = fromIntegral $ scrRows st
--} \ No newline at end of file
nihil fit ex nihilo