diff options
author | Raúl Benencia <rul@kalgan.cc> | 2013-09-03 15:24:40 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2013-09-03 15:24:40 -0300 |
commit | de8bde7be0a8ab99dbbf5cdbf6e5fc7fc582da01 (patch) | |
tree | a752ee80ed061fcf4ab49fe6d2a98c6f0af27af7 | |
parent | fc7a8483f4a66a3f47bbb335574a399df64d62e0 (diff) |
Solved row overflow bug
-rw-r--r-- | Print.hs | 2 | ||||
-rw-r--r-- | Screen.hs | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -43,7 +43,7 @@ ppFlag FORWARDED = 'P' ppFlag DELETED = 'T' ppFlag (OTHERFLAG [c]) = c -ppSep = "\t" +ppSep = " " normalizeLen len cs = if (length cs > len) then shorten len cs @@ -50,6 +50,7 @@ startCurses = do cfg <- ask (=<<) put $ liftCurses $ do setEcho False + setCursorMode CursorInvisible (rows, cols) <- screenSize basColID <- newColorID (fst . baseColor $ cfg) (snd . baseColor $ cfg) 1 selColID <- newColorID (fst . selectionColor $ cfg) (snd . selectionColor $ cfg) 2 @@ -135,6 +136,7 @@ drawSimpleRow st path str | (mode st) == MaildirMode = drawString $ normalizeLen {- Empty the whole window. Useful when changing modes. -} clearMain rows columns = do drawEmptyLine 0 + moveCursor 0 0 where drawEmptyLine currentRow = do moveCursor currentRow 0 @@ -164,7 +166,7 @@ drawEmailHeaders = do liftUpdate $ do setColor $ headerColorID . colorStyle $ st - drawHeaders st (curRowAsInteger st) parsedHeaders + drawHeaders st (curRowAsInteger st) parsedHeaders setColor $ baseColorID . colorStyle $ st put $ st { currentRow = 1 + (length parsedHeaders) + (currentRow st) } @@ -195,9 +197,9 @@ drawBody row col maxRows (xs:xss) = do drawStatus = do st <- get liftUpdate $ do - moveCursor ((scrRowsAsInteger st) - 1) 0 + moveCursor (scrRowsAsInteger st) 0 setColor $ statusBarColorID . colorStyle $ st - drawCroppedString st $ concat $ drawStatusHelper (mode st) st + drawString $ normalizeLen (screenColumns st - 1)$ concat $ drawStatusHelper (mode st) st -- Can't write in the last char - ncurses bug setColor $ baseColorID . colorStyle $ st {- Status bar string for Maildir mode -} |