yi-0.8.1: The Haskell-Scriptable Editor

Safe HaskellNone
LanguageHaskell2010

Yi.Completion

Synopsis

Documentation

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

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 String Source

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 String Source

Prefix matching function, for use with completeInList

infixMatch :: String -> String -> Maybe String Source

Infix matching function, for use with completeInList

subsequenceMatch :: String -> String -> Bool Source

Example: "abc" matches "a1b2c"