License | GPL-2 |
---|---|
Maintainer | yi-devel@googlegroups.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
Functions working with the minibuffer.
- spawnMinibufferE :: Text -> KeymapEndo -> EditorM BufferRef
- withMinibufferFree :: Text -> (Text -> YiM ()) -> YiM ()
- withMinibuffer :: Text -> (Text -> YiM [Text]) -> (Text -> YiM ()) -> YiM ()
- withMinibufferGen :: Text -> (Text -> YiM [Text]) -> Text -> (Text -> YiM Text) -> (Text -> YiM ()) -> (Text -> YiM ()) -> YiM ()
- withMinibufferFin :: Text -> [Text] -> (Text -> YiM ()) -> YiM ()
- noHint :: a -> YiM [a]
- noPossibilities :: String -> YiM [String]
- mkCompleteFn :: (Text -> (Text -> Maybe Text) -> [Text] -> EditorM Text) -> (Text -> Text -> Maybe Text) -> (Text -> YiM [Text]) -> Text -> YiM Text
- simpleComplete :: (Text -> YiM [Text]) -> Text -> YiM Text
- infixComplete :: (Text -> YiM [Text]) -> Text -> YiM Text
- infixComplete' :: Bool -> (Text -> YiM [Text]) -> Text -> YiM Text
- anyModeByName :: Text -> YiM AnyMode
- getAllModeNames :: YiM [Text]
- matchingBufferNames :: YiM [Text]
- anyModeByNameM :: Text -> YiM (Maybe AnyMode)
- anyModeName :: AnyMode -> Text
- newtype t ::: doc = Doc {
- fromDoc :: t
- data LineNumber
- data RegexTag
- data FilePatternTag
- data ToKill
- newtype CommandArguments = CommandArguments [Text]
- commentRegion :: YiM ()
- promptingForBuffer :: Text -> (BufferRef -> YiM ()) -> ([BufferRef] -> [BufferRef] -> [BufferRef]) -> YiM ()
- debugBufferContent :: YiM ()
Documentation
spawnMinibufferE :: Text -> KeymapEndo -> EditorM BufferRef Source #
Open a minibuffer window with the given prompt and keymap
The third argument is an action to perform after the minibuffer
is opened such as move to the first occurence of a searched for
string. If you don't need this just supply return ()
withMinibufferFree :: Text -> (Text -> YiM ()) -> YiM () Source #
withMinibufferFree prompt act
:
Simple version of withMinibufferGen
withMinibuffer :: Text -> (Text -> YiM [Text]) -> (Text -> YiM ()) -> YiM () Source #
withMinibuffer prompt completer act
: open a minibuffer with prompt
. Once
a string s
is obtained, run act s
. completer
can be used to complete
functions: it returns a list of possible matches.
withMinibufferGen :: Text -> (Text -> YiM [Text]) -> Text -> (Text -> YiM Text) -> (Text -> YiM ()) -> (Text -> YiM ()) -> YiM () Source #
withMinibufferGen proposal getHint prompt completer onTyping act
:
open a minibuffer with prompt
, and initial content proposal
. Once
a string s
is obtained, run act s
. completer
can be used to
complete inputs by returning an incrementally better match, and
getHint can give an immediate feedback to the user on the current
input.
on Typing
is an extra action which will fire with every user
key-press and receives minibuffer contents. Use something like
const $ return ()
if you don't need this.
withMinibufferFin :: Text -> [Text] -> (Text -> YiM ()) -> YiM () Source #
Open a minibuffer, given a finite number of suggestions.
noHint :: a -> YiM [a] Source #
Hint function that does nothing, for use with withMinibufferGen
:: (Text -> (Text -> Maybe Text) -> [Text] -> EditorM Text) | List completion, such as |
-> (Text -> Text -> Maybe Text) | Matcher such as |
-> (Text -> YiM [Text]) | Function to fetch possibilites for completion. |
-> Text | Input to try and complete against |
-> YiM Text |
Makes a completion function.
getAllModeNames :: YiM [Text] Source #
matchingBufferNames :: YiM [Text] Source #
Returns all the buffer names
anyModeName :: AnyMode -> Text Source #
Tag a type with a documentation
data LineNumber Source #
data FilePatternTag Source #
newtype CommandArguments Source #
commentRegion :: YiM () Source #
Prompts the user for comment syntax to use for the current mode.
:: Text | Prompt |
-> (BufferRef -> YiM ()) | Handler |
-> ([BufferRef] -> [BufferRef] -> [BufferRef]) | Hint pre-processor. It takes the list of open buffers and a list of all buffers, and should spit out all the buffers to possibly hint, in the wanted order. Note the hinter uses name prefix for filtering regardless of what you do here. |
-> YiM () |
Prompts for a buffer name, turns it into a BufferRef
and passes
it on to the handler function. Uses all known buffers for hinting.
debugBufferContent :: YiM () Source #
Prints out the rope of the current buffer as-is to stdout.
The only way to stop it is to close the buffer in question which
should free up the BufferRef
.