Allow for scrolling in combine regex
This commit is contained in:
@@ -10,16 +10,15 @@ import LensHelp
|
||||
|
||||
setShownIntMap :: SelectionIntMap a -> SelectionIntMap a
|
||||
setShownIntMap sm = case sm ^. smRegex of
|
||||
NoSMRegex -> sm & smShownItems .~ IM.fromAscList (zip [0..] allitms)
|
||||
SMRegex str _ -> sm & smShownItems
|
||||
Nothing -> sm & smShownItems .~ IM.fromAscList (zip [0..] allitms)
|
||||
Just str -> sm & smShownItems
|
||||
.~ IM.fromAscList (zip [0..] (f str : filter (regexList str . _siPictures) allitms))
|
||||
where
|
||||
allitms = sm ^. smItems
|
||||
f str = SelectionInfo
|
||||
f str = SelectionRegex
|
||||
{ _siPictures = ["FILTER: " ++ str]
|
||||
, _siHeight = 1
|
||||
, _siIsSelectable = False
|
||||
--, _siWidth = length ("FILTER: " ++ str)
|
||||
, _siIsSelectable = True
|
||||
, _siColor = white
|
||||
, _siOffX = 0
|
||||
}
|
||||
@@ -27,7 +26,9 @@ setShownIntMap sm = case sm ^. smRegex of
|
||||
initialSelPos :: SelectionIntMap a -> SelectionIntMap a
|
||||
initialSelPos sm = sm & smSelPos .~ mi
|
||||
where
|
||||
mi = fst <$> ifind (const _siIsSelectable) (sm ^. smShownItems)
|
||||
mi = fst <$> ifind t (sm ^. smShownItems)
|
||||
t _ SelectionRegex{} = False
|
||||
t _ si = _siIsSelectable si
|
||||
|
||||
-- assumes that at least one item is selectable!
|
||||
-- also assumes that the integer is 1 or -1
|
||||
|
||||
Reference in New Issue
Block a user