yi-core-0.19.4: Yi editor core library

License | GPL-2
Maintainer | yi-devel@googlegroups.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Extensions

- UndecidableInstances
- ScopedTypeVariables
- OverloadedStrings
- DeriveDataTypeable
- TypeSynonymInstances
- FlexibleInstances
- ConstrainedClassMethods
- MultiParamTypeClasses
- GeneralizedNewtypeDeriving
- TypeOperators
- ExplicitNamespaces
- ExplicitForAll
- LambdaCase

Yi.MiniBuffer

Contents

- Orphan instances

Description

Functions working with the minibuffer.

Synopsis

- 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 ()

# 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 occurrence 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``

noPossibilities :: String -> YiM [String] Source #

mkCompleteFn Source #

Arguments

:: (Text -> (Text -> Maybe Text) -> [Text] -> EditorM Text) | List completion, such as `completeInList`.
-> (Text -> Text -> Maybe Text) | Matcher such as `prefixMatch`
-> (Text -> YiM [Text]) | Function to fetch possibilites for completion.
-> Text | Input to try and complete against
-> YiM Text |

Makes a completion function.

simpleComplete :: (Text -> YiM [Text]) -> Text -> YiM Text Source #

infixComplete :: (Text -> YiM [Text]) -> Text -> YiM Text Source #

infixComplete' :: Bool -> (Text -> YiM [Text]) -> Text -> YiM Text Source #

anyModeByName :: Text -> YiM AnyMode Source #

getAllModeNames :: YiM [Text] Source #

matchingBufferNames :: YiM [Text] Source #

Returns all the buffer names

anyModeByNameM :: Text -> YiM (Maybe AnyMode) Source #

anyModeName :: AnyMode -> Text Source #

newtype t ::: doc Source #

Tag a type with a documentation

Constructors

Doc |

Fields

- fromDoc :: t

#### Instances

Instances details

IsString t => IsString (t ::: doc) Source # |
Instance details Defined in Yi.MiniBuffer Methods fromString :: String -> t ::: doc Source #
Num t => Num (t ::: doc) Source # |
Instance details Defined in Yi.MiniBuffer Methods (+) :: (t ::: doc) -> (t ::: doc) -> t ::: doc Source # (-) :: (t ::: doc) -> (t ::: doc) -> t ::: doc Source # (*) :: (t ::: doc) -> (t ::: doc) -> t ::: doc Source # negate :: (t ::: doc) -> t ::: doc Source # abs :: (t ::: doc) -> t ::: doc Source # signum :: (t ::: doc) -> t ::: doc Source # fromInteger :: Integer -> t ::: doc Source #
Show x => Show (x ::: t) Source # |
Instance details Defined in Yi.MiniBuffer Methods showsPrec :: Int -> (x ::: t) -> ShowS Source # show :: (x ::: t) -> String Source # showList :: [x ::: t] -> ShowS Source #
Eq t => Eq (t ::: doc) Source # |
Instance details Defined in Yi.MiniBuffer Methods (==) :: (t ::: doc) -> (t ::: doc) -> Bool Source # (/=) :: (t ::: doc) -> (t ::: doc) -> Bool Source #

data LineNumber Source #

data RegexTag Source #

data FilePatternTag Source #

data ToKill Source #

newtype CommandArguments Source #

Constructors

CommandArguments [Text] |

#### Instances

Instances details

Show CommandArguments Source # |
Instance details Defined in Yi.MiniBuffer Methods showsPrec :: Int -> CommandArguments -> ShowS Source # show :: CommandArguments -> String Source # showList :: [CommandArguments] -> ShowS Source #
Eq CommandArguments Source # |
Instance details Defined in Yi.MiniBuffer Methods (==) :: CommandArguments -> CommandArguments -> Bool Source # (/=) :: CommandArguments -> CommandArguments -> Bool Source #

commentRegion :: YiM () Source #

Prompts the user for comment syntax to use for the current mode.

promptingForBuffer Source #

Arguments

:: 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.

# Orphan instances

(YiAction a x, Promptable r) => YiAction (r -> a) x Source # |
Instance details Methods makeAction :: (r -> a) -> Action Source #