summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-12-27 23:25:03 +0100
committertv <tv@shackspace.de>2014-12-27 23:25:03 +0100
commit98facf82ff30e56b14367c3c303dd553daa1d48d (patch)
tree5503557849cf335c92a3c9876f8c2f8844a968b4
parent6b9ed1ce38f82f69950dcf1dc8474b47470fd18f (diff)
kill ghosts after EOF, vi-style
-rw-r--r--test4.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/test4.hs b/test4.hs
index 893d120..cf5ad3e 100644
--- a/test4.hs
+++ b/test4.hs
@@ -110,11 +110,16 @@ redraw _q@State{..} = do
-- consumes 1 screenHeight
putStr $ "\ESC[2K" ++ flashMessage ++ " " ++ show (screenWidth, screenHeight)
+
+ let buf = map (take screenWidth . drop xoffset) $
+ take (screenHeight - 1) $
+ drop yoffset $
+ renderTreeView (Z.label cursor) (Z.toTree cursor)
+
mapM_ (putStr . ("\n\ESC[2K"++)) $
- map (take screenWidth . drop xoffset) $
- take (screenHeight - 1) $
- drop yoffset $
- renderTreeView (Z.label cursor) (Z.toTree cursor)
+ buf
+ ++
+ take (screenHeight - 1 - length buf) (repeat "~")