mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-04 22:21:54 -07:00
Merge pull request #505 from slotThe/hl-item
X.Prompt: Special handling of one highlighted item
This commit is contained in:
@@ -410,9 +410,10 @@ highlightedItem st' completions = case complWinDim st' of
|
|||||||
(_,_,_,_,xx,yy) = winDim
|
(_,_,_,_,xx,yy) = winDim
|
||||||
complMatrix = splitInSubListsAt (length yy) (take (length xx * length yy) completions)
|
complMatrix = splitInSubListsAt (length yy) (take (length xx * length yy) completions)
|
||||||
(col_index,row_index) = complIndex st'
|
(col_index,row_index) = complIndex st'
|
||||||
in case completions of
|
in case length completions of
|
||||||
[] -> Nothing
|
0 -> Nothing
|
||||||
_ -> complMatrix !? col_index >>= (!? row_index)
|
1 -> Just $ complMatrix !! col_index !! row_index
|
||||||
|
_ -> complMatrix !? col_index >>= (!? row_index)
|
||||||
where
|
where
|
||||||
-- | Safe version of '(!!)'.
|
-- | Safe version of '(!!)'.
|
||||||
(!?) :: [a] -> Int -> Maybe a
|
(!?) :: [a] -> Int -> Maybe a
|
||||||
|
Reference in New Issue
Block a user