diff options
author | Raúl Benencia <rul@kalgan.cc> | 2013-08-25 18:11:50 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2013-08-25 18:11:50 -0300 |
commit | 3e861fe72dbdbd819aed7c67dddb4e820dee0f66 (patch) | |
tree | 15df4f7d530ee1db1d969b7caba93e74506e8451 /Screen.hs | |
parent | f25d0d8d82dff0be2d68476148479004b2888bd7 (diff) |
refactored screenLoop
Diffstat (limited to 'Screen.hs')
-rw-r--r-- | Screen.hs | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -60,16 +60,14 @@ startCurses = do screenLoop :: LazymailCurses () screenLoop = do w <- liftCurses $ defaultWindow - st <- get cfg <- ask - (_, st') <- liftCurses $ updateWindow w $ runStateT (runReaderT performUpdate cfg) st - put st' + get >>= \st -> + (liftCurses . (updateWindow w) $ runStateT (runReaderT performUpdate cfg) st) >>= put . snd liftCurses $ render handleEvent - st <- get - if (not . exitRequested) st - then screenLoop - else return () + get >>= \st -> if (not . exitRequested) st + then screenLoop + else return () --performUpdate :: LazymailUpdate () performUpdate = do @@ -121,7 +119,6 @@ clearMain rows columns = do then drawEmptyLine $ currentRow + 1 else return () - -- | Helper function of drawMode drawIndexHelper [] = resetCurrentRow drawIndexHelper ((fp, _, msg):ts) = do |