yi-0.12.6: The Haskell-Scriptable Editor

LicenseGPL-2
Maintaineryi-devel@googlegroups.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • OverloadedStrings
  • NondecreasingIndentation

Yi.Completion

Description

Collection of functions for completion and matching.

Synopsis

Documentation

completeInList Source #

Arguments

:: Text

Input to match on

-> (Text -> Maybe Text)

matcher function

-> [Text]

items to match against

-> EditorM Text 

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

Arguments

:: (Text -> Text)

Show function

-> Text

Input to match on

-> (Text -> Maybe Text)

matcher function

-> [Text]

items to match against

-> EditorM Text 

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

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

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 :: Text -> Text -> Maybe Text Source #

Prefix matching function, for use with completeInList

infixMatch :: Text -> Text -> Maybe Text Source #

Infix matching function, for use with completeInList

subsequenceMatch :: String -> String -> Bool Source #

Example: "abc" matches "a1b2c"

containsMatch' :: Bool -> Text -> Text -> Maybe Text Source #

TODO: this is a terrible function, isn't this just case-insensitive infix? – Fūzetsu

mkIsPrefixOf Source #

Arguments

:: Bool

Is case-sensitive?

-> Text 
-> Text 
-> Bool 

Like usual isPrefixOf but user can specify case sensitivity. See toCaseFold for exotic unicode gotchas.