yi-0.7.2: The Haskell-Scriptable Editor

Safe HaskellNone

Yi.Completion

Synopsis

Documentation

completeInList :: String -> (String -> Maybe String) -> [String] -> EditorM StringSource

Complete a string given a user input string, a matching function and a list of possibilites. Matching function should return the part of the string that matches the user string.

completeInListCustomShow :: (String -> String) -> String -> (String -> Maybe String) -> [String] -> EditorM StringSource

Same as completeInList, but maps showFunction on possible matches when printing

commonPrefix :: Eq a => [[a]] -> [a]Source

Return the longest common prefix of a set of lists.

 P(xs) === all (isPrefixOf (commonPrefix xs)) xs
 length s > length (commonPrefix xs) --> not (all (isPrefixOf s) xs)

prefixMatch :: String -> String -> Maybe StringSource

Prefix matching function, for use with completeInList

infixMatch :: String -> String -> Maybe StringSource

Infix matching function, for use with completeInList

subsequenceMatch :: String -> String -> BoolSource

Example: abc matches a1b2c

mkIsPrefixOf :: Bool -> String -> String -> BoolSource