| License | GPL-2 | 
|---|---|
| Maintainer | yi-devel@googlegroups.com | 
| Stability | experimental | 
| Portability | portable | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
| Extensions | 
  | 
Yi.Types
Description
This module is the host of the most prevalent types throughout Yi. It is unfortunately a necessary evil to avoid use of bootfiles.
You're encouraged to import from more idiomatic modules which will re-export these where appropriate.
Synopsis
- data Action
 - emptyAction :: Action
 - class (Default a, Binary a, Typeable a) => YiVariable a
 - class (Default a, Typeable a) => YiConfigVariable a
 - type Interact ev a = I ev Action a
 - type KeymapM a = Interact Event a
 - type Keymap = KeymapM ()
 - type KeymapEndo = Keymap -> Keymap
 - type KeymapProcess = P Event Action
 - data IsRefreshNeeded
 - data Yi = Yi {}
 - data YiVar = YiVar {}
 - newtype YiM a = YiM {}
 - unsafeWithEditor :: Config -> MVar YiVar -> EditorM a -> IO a
 - data KeymapSet = KeymapSet {}
 - extractTopKeymap :: KeymapSet -> Keymap
 - newtype BufferM a = BufferM {
- fromBufferM :: ReaderT Window (State FBuffer) a
 
 - data IndentSettings = IndentSettings {
- expandTabs :: !Bool
 - tabSize :: !Int
 - shiftWidth :: !Int
 
 - data FBuffer = forall syntax.FBuffer {
- bmode :: !(Mode syntax)
 - rawbuf :: !(BufferImpl syntax)
 - attributes :: !Attributes
 
 - type WinMarks = MarkSet Mark
 - data MarkSet a = MarkSet {}
 - data Attributes = Attributes {
- ident :: !BufferId
 - bkey__ :: !BufferRef
 - undos :: !URList
 - bufferDynamic :: !DynamicState
 - preferCol :: !(Maybe Int)
 - preferVisCol :: !(Maybe Int)
 - stickyEol :: !Bool
 - pendingUpdates :: !(Seq UIUpdate)
 - selectionStyle :: !SelectionStyle
 - keymapProcess :: !KeymapProcess
 - winMarks :: !(Map WindowRef WinMarks)
 - lastActiveWindow :: !Window
 - lastSyncTime :: !UTCTime
 - readOnly :: !Bool
 - inserting :: !Bool
 - directoryContent :: !Bool
 - pointFollowsWindow :: !(Set WindowRef)
 - updateTransactionInFlight :: !Bool
 - updateTransactionAccum :: !(Seq Update)
 - fontsizeVariation :: !Int
 - updateStream :: !(Seq Update)
 
 - data BufferId
- = MemBuffer !Text
 - | FileBuffer !FilePath
 
 - data SelectionStyle = SelectionStyle {}
 - data AnyMode = forall syntax. AnyMode (Mode syntax)
 - data Mode syntax = Mode {
- modeName :: Text
 - modeApplies :: FilePath -> YiString -> Bool
 - modeHL :: ExtHL syntax
 - modePrettify :: syntax -> BufferM ()
 - modeKeymap :: KeymapSet -> KeymapSet
 - modeIndent :: syntax -> IndentBehaviour -> BufferM ()
 - modeFollow :: syntax -> Action
 - modeIndentSettings :: IndentSettings
 - modeToggleCommentSelection :: Maybe (BufferM ())
 - modeGetStrokes :: syntax -> Point -> Point -> Point -> [Stroke]
 - modeOnLoad :: BufferM ()
 - modeModeLine :: [Text] -> BufferM Text
 - modeGotoDeclaration :: BufferM ()
 
 - data IndentBehaviour
 - type Status = ([Text], StyleName)
 - type Statuses = DelayList Status
 - data Editor = Editor {
- bufferStack :: !(NonEmpty BufferRef)
 - buffers :: !(Map BufferRef FBuffer)
 - refSupply :: !Int
 - tabs_ :: !(PointedList Tab)
 - dynamic :: !DynamicState
 - statusLines :: !Statuses
 - maxStatusHeight :: !Int
 - killring :: !Killring
 - currentRegex :: !(Maybe SearchExp)
 - searchDirection :: !Direction
 - pendingEvents :: ![Event]
 - onCloseActions :: !(Map BufferRef (EditorM ()))
 
 - newtype EditorM a = EditorM {
- fromEditorM :: ReaderT Config (State Editor) a
 
 - class (Monad m, MonadState Editor m) => MonadEditor m where
- askCfg :: m Config
 - withEditor :: EditorM a -> m a
 - withEditor_ :: EditorM a -> m ()
 
 - runEditor :: Config -> EditorM a -> Editor -> (Editor, a)
 - data UIConfig = UIConfig {
- configFontName :: Maybe String
 - configFontSize :: Maybe Int
 - configScrollStyle :: Maybe ScrollStyle
 - configScrollWheelAmount :: Int
 - configLeftSideScrollBar :: Bool
 - configAutoHideScrollBar :: Bool
 - configAutoHideTabBar :: Bool
 - configLineWrap :: Bool
 - configCursorStyle :: CursorStyle
 - configWindowFill :: Char
 - configTheme :: Theme
 - configLineNumbers :: Bool
 
 - type UIBoot = Config -> ([Event] -> IO ()) -> ([Action] -> IO ()) -> Editor -> IO (UI Editor)
 - data CursorStyle
 - data Config = Config {
- startFrontEnd :: UIBoot
 - configUI :: !UIConfig
 - startActions :: ![Action]
 - initialActions :: ![Action]
 - defaultKm :: !KeymapSet
 - configInputPreprocess :: !(P Event Event)
 - modeTable :: ![AnyMode]
 - debugMode :: !Bool
 - configRegionStyle :: !RegionStyle
 - configKillringAccumulate :: !Bool
 - configCheckExternalChangesObsessively :: !Bool
 - bufferUpdateHandler :: !(Seq (Seq Update -> BufferM ()))
 - layoutManagers :: ![AnyLayoutManager]
 - configVars :: !DynamicState
 
 - data RegionStyle
 
Documentation
Constructors
| forall a.Show a => YiA (YiM a) | |
| forall a.Show a => EditorA (EditorM a) | |
| forall a.Show a => BufferA (BufferM a) | 
emptyAction :: Action Source #
class (Default a, Binary a, Typeable a) => YiVariable a Source #
Instances
| YiVariable CabalBuffer Source # | |
Defined in Yi.Command  | |
| YiVariable Histories Source # | |
Defined in Yi.History  | |
| YiVariable RegionStyle Source # | |
Defined in Yi.Types  | |
class (Default a, Typeable a) => YiConfigVariable a Source #
Instances
| YiConfigVariable Evaluator Source # | |
Defined in Yi.Eval  | |
type KeymapEndo = Keymap -> Keymap Source #
data IsRefreshNeeded Source #
Constructors
| MustRefresh | |
| NoNeedToRefresh | 
Instances
| Show IsRefreshNeeded Source # | |
Defined in Yi.Types Methods showsPrec :: Int -> IsRefreshNeeded -> ShowS # show :: IsRefreshNeeded -> String # showList :: [IsRefreshNeeded] -> ShowS #  | |
| Eq IsRefreshNeeded Source # | |
Defined in Yi.Types Methods (==) :: IsRefreshNeeded -> IsRefreshNeeded -> Bool # (/=) :: IsRefreshNeeded -> IsRefreshNeeded -> Bool #  | |
Constructors
| Yi | |
Constructors
| YiVar | |
Fields  | |
The type of user-bindable functions TODO: doc how these are actually user-bindable are they?
Instances
| MonadFail YiM Source # | |
| Applicative YiM Source # | |
| Functor YiM Source # | |
| Monad YiM Source # | |
| MonadEditor YiM Source # | |
| MonadReader Yi YiM Source # | |
| MonadState Editor YiM Source # | |
| MonadBase IO YiM Source # | |
| HookType (YiM a) Source # | |
Defined in Yi.Hooks Methods runHookImpl :: YiConfigVariable var => (var -> YiM a) -> YiM a  | |
| YiAction (YiM x) x Source # | |
Constructors
| KeymapSet | |
Fields 
  | |
extractTopKeymap :: KeymapSet -> Keymap Source #
The BufferM monad writes the updates performed.
data IndentSettings Source #
Currently duplicates some of Vim's indent settings. Allowing a buffer to specify settings that are more dynamic, perhaps via closures, could be useful.
Constructors
| IndentSettings | |
Fields 
  | |
Instances
| Show IndentSettings Source # | |
Defined in Yi.Types Methods showsPrec :: Int -> IndentSettings -> ShowS # show :: IndentSettings -> String # showList :: [IndentSettings] -> ShowS #  | |
| Eq IndentSettings Source # | |
Defined in Yi.Types Methods (==) :: IndentSettings -> IndentSettings -> Bool # (/=) :: IndentSettings -> IndentSettings -> Bool #  | |
Constructors
| forall syntax. FBuffer | |
Fields 
  | |
Instances
| Foldable MarkSet Source # | |
Defined in Yi.Types Methods fold :: Monoid m => MarkSet m -> m # foldMap :: Monoid m => (a -> m) -> MarkSet a -> m # foldMap' :: Monoid m => (a -> m) -> MarkSet a -> m # foldr :: (a -> b -> b) -> b -> MarkSet a -> b # foldr' :: (a -> b -> b) -> b -> MarkSet a -> b # foldl :: (b -> a -> b) -> b -> MarkSet a -> b # foldl' :: (b -> a -> b) -> b -> MarkSet a -> b # foldr1 :: (a -> a -> a) -> MarkSet a -> a # foldl1 :: (a -> a -> a) -> MarkSet a -> a # elem :: Eq a => a -> MarkSet a -> Bool # maximum :: Ord a => MarkSet a -> a # minimum :: Ord a => MarkSet a -> a #  | |
| Traversable MarkSet Source # | |
| Functor MarkSet Source # | |
| Show a => Show (MarkSet a) Source # | |
| Binary a => Binary (MarkSet a) Source # | |
data Attributes Source #
Constructors
| Attributes | |
Fields 
  | |
Instances
| Binary Attributes Source # | |
Defined in Yi.Types  | |
Constructors
| MemBuffer !Text | |
| FileBuffer !FilePath | 
data SelectionStyle Source #
Constructors
| SelectionStyle | |
Fields 
  | |
Instances
| Show SelectionStyle Source # | |
Defined in Yi.Types Methods showsPrec :: Int -> SelectionStyle -> ShowS # show :: SelectionStyle -> String # showList :: [SelectionStyle] -> ShowS #  | |
| Binary SelectionStyle Source # | |
Defined in Yi.Types Methods put :: SelectionStyle -> Put # get :: Get SelectionStyle # putList :: [SelectionStyle] -> Put #  | |
A Mode customizes the Yi interface for editing a particular data format. It specifies when the mode should be used and controls file-specific syntax highlighting and command input, among other things.
Constructors
| Mode | |
Fields 
  | |
data IndentBehaviour Source #
Used to specify the behaviour of the automatic indent command.
Constructors
| IncreaseCycle | Increase the indentation to the next higher indentation hint. If we are currently at the highest level of indentation then cycle back to the lowest.  | 
| DecreaseCycle | Decrease the indentation to the next smaller indentation hint. If we are currently at the smallest level then cycle back to the largest  | 
| IncreaseOnly | Increase the indentation to the next higher hint if no such hint exists do nothing.  | 
| DecreaseOnly | Decrease the indentation to the next smaller indentation hint, if no such hint exists do nothing.  | 
Instances
| Show IndentBehaviour Source # | |
Defined in Yi.Types Methods showsPrec :: Int -> IndentBehaviour -> ShowS # show :: IndentBehaviour -> String # showList :: [IndentBehaviour] -> ShowS #  | |
| Eq IndentBehaviour Source # | |
Defined in Yi.Types Methods (==) :: IndentBehaviour -> IndentBehaviour -> Bool # (/=) :: IndentBehaviour -> IndentBehaviour -> Bool #  | |
The Editor state
Constructors
| Editor | |
Fields 
  | |
Instances
| MonadFail EditorM Source # | |
| Applicative EditorM Source # | |
| Functor EditorM Source # | |
| Monad EditorM Source # | |
| MonadEditor EditorM Source # | |
| MonadReader Config EditorM Source # | |
| MonadState Editor EditorM Source # | |
| HookType (EditorM a) Source # | |
Defined in Yi.Hooks Methods runHookImpl :: YiConfigVariable var => (var -> EditorM a) -> EditorM a  | |
| YiAction (EditorM x) x Source # | |
class (Monad m, MonadState Editor m) => MonadEditor m where Source #
Minimal complete definition
Instances
Constructors
| UIConfig | |
Fields 
  | |
type UIBoot = Config -> ([Event] -> IO ()) -> ([Action] -> IO ()) -> Editor -> IO (UI Editor) Source #
data CursorStyle Source #
When should we use a "fat" cursor (i.e. 2 pixels wide, rather than 1)? Fat cursors have only been implemented for the Pango frontend.
Constructors
| AlwaysFat | |
| NeverFat | |
| FatWhenFocused | |
| FatWhenFocusedAndInserting | 
Configuration record. All Yi hooks can be set here.
Constructors
| Config | |
Fields 
  | |
Instances
data RegionStyle Source #
Instances
| Show RegionStyle Source # | |
Defined in Yi.Types Methods showsPrec :: Int -> RegionStyle -> ShowS # show :: RegionStyle -> String # showList :: [RegionStyle] -> ShowS #  | |
| Binary RegionStyle Source # | |
Defined in Yi.Types  | |
| Default RegionStyle Source # | |
Defined in Yi.Types Methods def :: RegionStyle #  | |
| Eq RegionStyle Source # | |
Defined in Yi.Types  | |
| YiVariable RegionStyle Source # | |
Defined in Yi.Types  | |