module SelectF(selectF,selectF') where import Fudgets --import TextF import HbcUtils(assoc) selectF = selectF' standard selectF' p multiple sh = loopThroughRightF (absF (selectSP [])) pickF where pickF = stripInputSP >^^=< pickListF' p sh hilight = Left . highlightItems . map fst selectSP sel = getSP $ \ msg -> case msg of Left x@(n,_) -> let sel' = if multiple then assoc (const $ filter ((/=n).fst) sel) (x:sel) sel n else [x] in putsSP [hilight sel', Right sel'] $ selectSP sel' Right xs -> putsSP [Left (replaceAll (map snd xs)), hilight sel', Right sel'] $ selectSP sel' where sel' = [(n,x) | (n,(b,x)) <- number 0 xs, b]