Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
This module provides the tab-completion logic used for nicknames and channels.
Synopsis
- class (IsString a, Ord a) => Prefix a where
- wordComplete :: Prefix a => WordCompletionMode -> Bool -> [a] -> [a] -> EditBox -> Maybe EditBox
- data WordCompletionMode = WordCompletionMode {}
- plainWordCompleteMode :: WordCompletionMode
- defaultNickWordCompleteMode :: WordCompletionMode
- slackNickWordCompleteMode :: WordCompletionMode
Documentation
class (IsString a, Ord a) => Prefix a where Source #
Class for types that are isomorphic to String
and which can support a total order and a prefix
predicate.
toString
(fromString
x) == xfromString
(toString
x) == xisPrefix
x y ==> x<=
y
isPrefix :: a -> a -> Bool Source #
Check if the first argument is a lexicographic prefix of the second.
toString :: a -> String Source #
Convert to a String
.
Instances
Prefix Text Source # | |
Prefix Identifier Source # | |
Defined in Client.Commands.WordCompletion isPrefix :: Identifier -> Identifier -> Bool Source # toString :: Identifier -> String Source # |
:: Prefix a | |
=> WordCompletionMode | leading update operation |
-> Bool | reversed |
-> [a] | priority completions |
-> [a] | possible completions |
-> EditBox | |
-> Maybe EditBox |
Perform word completion on a text box.
The leading update operation is applied to the result of tab-completion when tab completing from the beginning of the text box. This is useful when auto-completing a nick and including a trailing colon.
The reversed
parameter indicates that tab-completion should return the
previous entry. When starting a fresh tab completion the priority completions
will be considered in order before resorting to the set of possible
completions.
Word completion modes
data WordCompletionMode Source #
Word completion prefix and suffix
Instances
Show WordCompletionMode Source # | |
Defined in Client.Commands.WordCompletion showsPrec :: Int -> WordCompletionMode -> ShowS # show :: WordCompletionMode -> String # showList :: [WordCompletionMode] -> ShowS # |
plainWordCompleteMode :: WordCompletionMode Source #
Word completion without adding any prefix or suffix
defaultNickWordCompleteMode :: WordCompletionMode Source #
Word completion adding a ": " suffix at the beginning of lines
slackNickWordCompleteMode :: WordCompletionMode Source #
Word completion using a "@" prefix intended