From 876b1b23fb4b9901e4eebf11e39a46f76899afd3 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Wed, 23 Jan 2019 22:15:21 -0800 Subject: [PATCH] Fix XMonad.Prompt wraparound when maxComplRows not Nothing #217 --- XMonad/Prompt.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index 7ffa8128c7..09af5d6a29 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -589,8 +589,8 @@ completionHandle _ k e = handle k e nextComplIndex :: XPState -> Int -> (Int,Int) nextComplIndex st nitems = case complWinDim st of Nothing -> (0,0) --no window dims (just destroyed or not created) - Just (_,_,_,_,_,yy) -> let - (ncols,nrows) = (nitems `div` length yy + if (nitems `mod` length yy > 0) then 1 else 0, length yy) + Just (_,_,_,_,xx,yy) -> let + (ncols,nrows) = (length xx, length yy) (currentcol,currentrow) = complIndex st in if (currentcol + 1 >= ncols) then --hlight is in the last column if (currentrow + 1 < nrows ) then --hlight is still not at the last row