mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
XPrompt: a very long string in the completion list can lead to a division by zero
This commit is contained in:
parent
3a2c49b148
commit
8a5e61d0df
@ -463,7 +463,7 @@ getComplWinDim compl = do
|
|||||||
|
|
||||||
let compl_number = length compl
|
let compl_number = length compl
|
||||||
max_compl_len = (fi ht `div` 2) + (maximum . map (textWidth fontst) $ compl)
|
max_compl_len = (fi ht `div` 2) + (maximum . map (textWidth fontst) $ compl)
|
||||||
columns = wh `div` (fi max_compl_len)
|
columns = max 1 $ wh `div` (fi max_compl_len)
|
||||||
rem_height = rect_height scr - ht
|
rem_height = rect_height scr - ht
|
||||||
(rows,r) = compl_number `divMod` fi columns
|
(rows,r) = compl_number `divMod` fi columns
|
||||||
needed_rows = max 1 (rows + if r == 0 then 0 else 1)
|
needed_rows = max 1 (rows + if r == 0 then 0 else 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user