From c843d799140aacaf27cfadad545e485f35e1d385 Mon Sep 17 00:00:00 2001 From: "c.lopez" Date: Sun, 26 Aug 2012 10:31:37 +0200 Subject: fix a bug when ncompletions Ignore-this: 5f573028318473c333809217c271a81d darcs-hash:20120826083137-c3db2-f1fe3b8e2603aeffc888411261f364de2b4ef576.gz --- XMonad/Prompt.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'XMonad/Prompt.hs') diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index 0627b39..2548a56 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -527,12 +527,11 @@ 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 winDim -> let - (_,_,_,_,_,yy) = winDim + Just (_,_,_,_,_,yy) -> let (ncols,nrows) = (nitems `div` length yy + if (nitems `mod` length yy > 0) then 1 else 0, length yy) (currentcol,currentrow) = complIndex st in if (currentcol + 1 >= ncols) then --hlight is in the last column - if (currentrow + 1 < (nitems `mod` nrows) ) then --hlight is still not at the last row + if (currentrow + 1 < nrows ) then --hlight is still not at the last row (currentcol, currentrow + 1) else (0,0) -- cgit v1.2.3