Skip to content

Commit

Permalink
Fix cursor positioning in vty.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethercrow committed Oct 19, 2014
1 parent 750fc79 commit 64db6e9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions yi/src/library/Yi/UI/Vty.hs
Expand Up @@ -179,10 +179,12 @@ refresh fs e = do
(SL.offsetY promptRect)
(Vty.vertCat (fmap formatCmdLine niceCmd))
cursorPos =
case (\(w, r) -> (isMini w, cursor r)) (PL._focus windowsAndImages) of
(False, Just (y, x)) -> Vty.Cursor (toEnum x) (toEnum y)
(True, Just (_, x)) -> Vty.Cursor (toEnum x) (toEnum (rowCount - 1))
(_, Nothing) -> Vty.NoCursor
let (w, image) = PL._focus windowsAndImages
in case (isMini w, cursor image, winRects M.! wkey w) of
(False, Just (y, x), SL.Rect ox oy _ _) ->
Vty.Cursor (toEnum (x + ox)) (toEnum (y + oy - 1))
(True, Just (_, x), _) -> Vty.Cursor (toEnum x) (toEnum (rowCount - 1))
(_, Nothing, _) -> Vty.NoCursor
logPutStrLn "refreshing screen."
Vty.update (fsVty fs)
(Vty.picForLayers ([tabBarImage, cmdImage] ++ bigImages ++ miniImages))
Expand Down

0 comments on commit 64db6e9

Please sign in to comment.