on master help sign in
Cursor may be NoCursor
870ab1eYoshikuni Jujo
src/Graphics/Vty.hs+14−10
@@ -93,16 +93,20 @@ intMkVty kvar fend t = do
93 let inner_update in_pic = do
93 let inner_update in_pic = do
94 b <- display_bounds t
94 b <- display_bounds t
95 let DisplayRegion w h = b
95 let DisplayRegion w h = b
96− Cursor x y = pic_cursor in_pic
96+ cursor = pic_cursor in_pic
97+ in_pic' = case cursor of
98+ Cursor x y ->
99+ let
97− x' = case x of
100+ x' = case x of
98− _ | x >= 0x80000000 -> 0
101+ _ | x >= 0x80000000 -> 0
99− | x >= w -> w - 1
102+ | x >= w -> w - 1
100− | otherwise -> x
103+ | otherwise -> x
101− y' = case y of
104+ y' = case y of
102− _ | y >= 0x80000000 -> 0
105+ _ | y >= 0x80000000 -> 0
103− | y >= h -> h - 1
106+ | y >= h -> h - 1
104− | otherwise -> y
107+ | otherwise -> y
105− in_pic' = in_pic { pic_cursor = Cursor x' y' }
108+ in in_pic { pic_cursor = Cursor x' y' }
109+ _ -> in_pic
106 mlast_update <- readIORef last_update_ref
110 mlast_update <- readIORef last_update_ref
107 update_data <- case mlast_update of
111 update_data <- case mlast_update of
108 Nothing -> do
112 Nothing -> do