
3 Mar
2009
3 Mar
'09
1:21 p.m.
Владимир Сидоренко wrote:
Hi
I wrote my custom prompts for selecting playlists and songs in mpd and used mkComplFunFromList to make completion function. What is the easiest way to enable partial matching of input against completion list. I mean so that compare was like select .. from ... where ... like '%input%' ?
Thank you.
As far as I know, you'd have to define a custom completion function instead of creating it with mkComplFunFromList. So something like this should work: infixCompl _ [] = return [] infixCompl l s = return $ filter (s `isInfixOf`) l That would create a function that returns all the matches in the list if, the input string occurs in the element.