Safe Haskell | None |
---|---|
Language | Haskell2010 |
- viewports :: Action ()
- data View = View {}
- viewable :: Lens' View Viewable
- splitRule :: Lens' Split SplitRule
- active :: Lens' View Bool
- scrollPos :: Lens' View Int
- getViews :: Action (Maybe Window)
- data Split = Split {
- _dir :: Dir
- _splitRule :: SplitRule
- data Dir
- data SplitRule
- type Window = BiTree Split View
- data BiTree b l
- data BiTreeF b l r
- rotate :: Action ()
- closeInactive :: Action ()
- focusViewLeft :: Action ()
- focusViewRight :: Action ()
- focusViewAbove :: Action ()
- focusViewBelow :: Action ()
- hSplit :: Action ()
- vSplit :: Action ()
- addSplit :: BufAdded -> Action ()
- nextBuf :: Action ()
- prevBuf :: Action ()
- focusDo :: BufAction a -> Action [a]
- focusDo_ :: BufAction a -> Action ()
- focusedBufs :: Action [BufRef]
- isFocused :: BufAction Bool
- scrollBy :: Int -> Action ()
- data Widgets
- topBar :: Lens' Widgets [AnyRenderable]
- bottomBar :: Lens' Widgets [AnyRenderable]
- leftBar :: Lens' Widgets [AnyRenderable]
- rightBar :: Lens' Widgets [AnyRenderable]
- class HasWidgets r where
- addTopBar :: Renderable r => BufAction r -> BufAction ListenerId
- addBottomBar :: Renderable r => BufAction r -> BufAction ListenerId
- addLeftBar :: Renderable r => BufAction r -> BufAction ListenerId
- addRightBar :: Renderable r => BufAction r -> BufAction ListenerId
- enableLineNumbers :: BufAction ()
- disableLineNumbers :: BufAction ()
- toggleLineNumbers :: BufAction ()
- checkLineNumbers :: BufAction Bool
- addTopStatus :: Renderable r => BufAction r -> BufAction ListenerId
- addBottomStatus :: Renderable r => BufAction r -> BufAction ListenerId
Documentation
Working with Views
A View
contains info about a viewport; Whether it's selected and which buffer should be displayed.
HasWidgets View Source # | This represents types which can provide a set of widgets |
View Structure
Views are stored as a Tree, with Split
s determining
the layout of each branch.
A Split contains info about a the direction and allocation of a split branch.
Split | |
|
A SplitRule
determines size of each half of the split.
Ratio Double
sets the split to the given ratio; the double must be between 0 and 1; for example a value of0.25
sets the first portion of the split to 1/4 of the available space; the other portion takes the remaining 3/4 of the spaceFromStart Int
makes the first half of the split (top/left respectively) the set number of rows or columns respectively, the other half of the split gets the rest.FromEnd Int
makes the first half of the split (top/left respectively) the set number of rows or columns respectively, the other half of the split gets the rest.
Provided Actions
closeInactive :: Action () Source #
Close all inactive viewports
focusViewLeft :: Action () Source #
Move focus from any viewports one viewport to the left
focusViewRight :: Action () Source #
Move focus from any viewports one viewport to the right
focusViewAbove :: Action () Source #
Move focus from any viewports one viewport above
focusViewBelow :: Action () Source #
Move focus from any viewports one viewport below
addSplit :: BufAdded -> Action () Source #
Add a new split at the top level in the given direction containing the given buffer.
focusDo :: BufAction a -> Action [a] Source #
Run a bufAction over all focused buffers and return any results.
focusedBufs :: Action [BufRef] Source #
Get bufRefs for all buffers that are selected in at least one viewport
isFocused :: BufAction Bool Source #
Returns whether the current buffer is focused in at least one view.
Creating Widgets
Represents all widgets for a given view. Can be added onto using the Monoid instance.
Lenses for accessing parts of Widgets
:
class HasWidgets r where Source #
computeWidgets :: r -> Action Widgets Source #
HasWidgets View Source # | This represents types which can provide a set of widgets |
Providing Widgets
The following functions register a BufAction which yields some renderable; On each render that renderable will be used as a topbottomleft/right bar respectively.
addTopBar :: Renderable r => BufAction r -> BufAction ListenerId Source #
Use the computed renderer as a top-bar widget
addBottomBar :: Renderable r => BufAction r -> BufAction ListenerId Source #
Use the computed renderer as a bottom-bar widget
addLeftBar :: Renderable r => BufAction r -> BufAction ListenerId Source #
Use the computed renderer as a left-bar widget
addRightBar :: Renderable r => BufAction r -> BufAction ListenerId Source #
Use the computed renderer as a right-bar widget
Provided Widgets
enableLineNumbers :: BufAction () Source #
disableLineNumbers :: BufAction () Source #
toggleLineNumbers :: BufAction () Source #
checkLineNumbers :: BufAction Bool Source #
Returns whether line numbers are currently enabled.
addTopStatus :: Renderable r => BufAction r -> BufAction ListenerId Source #
This registers a BufAction
which results in a renderable and runs it
at render time to add the resulting Renderable
to the status bar.
addBottomStatus :: Renderable r => BufAction r -> BufAction ListenerId Source #