Skip to content

Commit 08462b6

Browse files
Better modal rendering.
1 parent 433adf1 commit 08462b6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

UI.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,9 @@ renderModal st (h, w) mkr = do
279279
hoffset = max 0 $ (w - mw) `div` 2
280280
vislines = (h - 5) `min` length modal'
281281
voffset = ((h - vislines) `div` 2) `max` 4
282-
Curses.wMove Curses.stdScr voffset hoffset
283-
for_ (take vislines modal') \t -> do
282+
for_ (zip [voffset..] $ take vislines modal') \ (y, t) -> do
283+
Curses.wMove Curses.stdScr y hoffset
284284
drawSegment $ Seg st.uiStyle.modals (toWidth mw t)
285-
(y', _) <- Curses.getYX Curses.stdScr
286-
Curses.wMove Curses.stdScr (y'+1) hoffset
287285

288286
-- | Choose modal to render based on state.
289287
renderModals :: HState -> (Int, Int) -> IO ()

0 commit comments

Comments
 (0)