on master help sign in
cursor should be inside of terminal

Ignore-this: 2c223dd0d9c789a712de9fc2dcf98d58 0 <= cursor x < terminal w 0 <= cursor y < terminal h darcs-hash:20100601042123-ffa78-b4f6b75c98253aab171858466bee01aff10d8a2c.gz

commitbd6a360d0bbdd674184f6be06096723c18e0b87a authorYoshikuni Jujo <PAF01143@nifty.ne.jp> dateMon 31 May 2010, 21:21 (16 years ago) parent93b8f8e
2 files changed+16−4
src/Graphics/Vty.hs+15−4 vty.cabal+1
src/Graphics/Vty.hs+15−4
@@ -92,23 +92,34 @@ intMkVty kvar fend t = do
9292
9393 let inner_update in_pic = do
9494 b <- display_bounds t
95+ let DisplayRegion w h = b
96+ Cursor x y = pic_cursor in_pic
97+ x' = case x of
98+ _ | x >= 0x80000000 -> 0
99+ | x >= w -> w - 1
100+ | otherwise -> x
101+ y' = case y of
102+ _ | y >= 0x80000000 -> 0
103+ | y >= h -> h - 1
104+ | otherwise -> y
105+ in_pic' = in_pic { pic_cursor = Cursor x' y' }
95106 mlast_update <- readIORef last_update_ref
96107 update_data <- case mlast_update of
97108 Nothing -> do
98109 d <- display_context t b
99− output_picture d in_pic
110+ output_picture d in_pic'
100111 return (b, d)
101112 Just (last_bounds, last_context) -> do
102113 if b /= last_bounds
103114 then do
104115 d <- display_context t b
105− output_picture d in_pic
116+ output_picture d in_pic'
106117 return (b, d)
107118 else do
108− output_picture last_context in_pic
119+ output_picture last_context in_pic'
109120 return (b, last_context)
110121 writeIORef last_update_ref $ Just update_data
111− writeIORef last_pic_ref $ Just in_pic
122+ writeIORef last_pic_ref $ Just in_pic'
112123
113124 let inner_refresh
114125 = writeIORef last_update_ref Nothing
vty.cabal+1
@@ -98,6 +98,7 @@ Extra-Source-Files: test/Makefile
9898 cbits/mk_wcwidth.c
9999 cbits/set_term_timing.c
100100 cbits/gwinsz.h
101+ cbits/output_buffer.h
101102
102103ghc-options: -O2 -funbox-strict-fields -Wall -fno-full-laziness -fspec-constr
103104ghc-prof-options: -O2 -funbox-strict-fields -caf-all -Wall -fno-full-laziness -fspec-constr