Move towards selection section inventory management
This commit is contained in:
@@ -26,9 +26,12 @@ setShownIntMap sm = case sm ^. smRegex of
|
||||
initialSelPos :: SelectionIntMap a -> SelectionIntMap a
|
||||
initialSelPos sm = sm & smSelPos .~ mi
|
||||
where
|
||||
mi = fst <$> ifind t (sm ^. smShownItems)
|
||||
t _ SelectionRegex{} = False
|
||||
t _ si = _siIsSelectable si
|
||||
mi = case sm ^? smShownItems . ix 0 of
|
||||
Nothing -> Nothing
|
||||
Just SelectionRegex {} -> case sm ^? smShownItems . ix 1 of
|
||||
Nothing -> Just 0
|
||||
Just _ -> Just 1
|
||||
_ -> Just 0
|
||||
|
||||
-- assumes that at least one item is selectable!
|
||||
-- also assumes that the integer is 1 or -1
|
||||
|
||||
Reference in New Issue
Block a user