mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -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
|
||||
complMatrix = splitInSubListsAt (length yy) (take (length xx * length yy) completions)
|
||||
(col_index,row_index) = complIndex st'
|
||||
in case completions of
|
||||
[] -> Nothing
|
||||
_ -> complMatrix !? col_index >>= (!? row_index)
|
||||
in case length completions of
|
||||
0 -> Nothing
|
||||
1 -> Just $ complMatrix !! col_index !! row_index
|
||||
_ -> complMatrix !? col_index >>= (!? row_index)
|
||||
where
|
||||
-- | Safe version of '(!!)'.
|
||||
(!?) :: [a] -> Int -> Maybe a
|
||||
|
Reference in New Issue
Block a user