Documentation ¶
Index ¶
- Constants
- type Context
- type Selection
- type SelectionType
- type StatusFunc
- type Tag
- func (t *Tag) AdjustEndLine(count int)
- func (t *Tag) AdjustEndOffset(count int)
- func (t *Tag) AdjustStartLine(count int)
- func (t *Tag) AdjustStartOffset(count int)
- func (t *Tag) EndPos() (int, int)
- func (t *Tag) FlipStartAndEndLines()
- func (t *Tag) FlipStartAndEndOffsets()
- func (t *Tag) SetEndOffset(e int)
- func (t *Tag) SetStartOffset(s int)
- func (t *Tag) StartPos() (int, int)
- type Tree
- func (t *Tree) Bottom() *Tree
- func (v *Tree) Draw()
- func (v *Tree) FirstLeafNode() *Tree
- func (t *Tree) Leaf() *View
- func (t *Tree) Left() *Tree
- func (v *Tree) NearestHSplit(dir int) *Tree
- func (v *Tree) NearestVSplit(dir int) *Tree
- func (t *Tree) NewLeaf(v *View) *Tree
- func (t *Tree) Parent() *Tree
- func (v *Tree) Reparent(parent *Tree)
- func (v *Tree) Resize(pos tulib.Rect)
- func (t *Tree) Right() *Tree
- func (t *Tree) SetParent(parent *Tree)
- func (v *Tree) Sibling() *Tree
- func (v *Tree) SplitHorizontally()
- func (v *Tree) SplitVertically()
- func (t *Tree) Top() *Tree
- func (v *Tree) Walk(cb func(*Tree))
- type View
- func (v *View) Attach(b *buffer.Buffer)
- func (v *View) Buffer() *buffer.Buffer
- func (l View) Cursor() buffer.Cursor
- func (v *View) CursorPosition() (int, int)
- func (v *View) Detach()
- func (v *View) MoveCursorTo(c buffer.Cursor)
- func (v *View) MoveCursorToLine(n int)
- func (v *View) MoveViewLines(n int)
- func (v *View) Selection() Selection
- func (v *View) SetHighlightBytes(b []byte)
- func (v *View) SetSelection(r Selection)
- func (v *View) SetStatus(format string, args ...interface{})
- func (v *View) ShowHighlights(b bool)
- func (v *View) UIBuf() tulib.Buffer
Constants ¶
const ( VerticalThreshold = 5 HorizontalThreshold = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext(setStatus StatusFunc, killBuffer *[]byte, buffers *[]*buffer.Buffer) Context
type Selection ¶
type Selection struct { buffer.Range Type SelectionType }
func (Selection) EffectiveRange ¶
type SelectionType ¶
type SelectionType int
const ( SelectionNone SelectionType = iota SelectionChar SelectionLine SelectionBlock )
type StatusFunc ¶
type StatusFunc func(format string, args ...interface{})
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
func (*Tag) AdjustEndLine ¶
func (*Tag) AdjustEndOffset ¶
func (*Tag) AdjustStartLine ¶
func (*Tag) AdjustStartOffset ¶
func (*Tag) FlipStartAndEndLines ¶
func (t *Tag) FlipStartAndEndLines()
func (*Tag) FlipStartAndEndOffsets ¶
func (t *Tag) FlipStartAndEndOffsets()
func (*Tag) SetEndOffset ¶
func (*Tag) SetStartOffset ¶
type Tree ¶
type Tree struct { tulib.Rect // updated with 'resize' call // contains filtered or unexported fields }
func NewTreeLeaf ¶
func (*Tree) FirstLeafNode ¶
func (*Tree) NearestHSplit ¶
NearestHSplit returns the Tree node with the nearest horizontally split neighbour view. dir argument controls the search direction; -1 searches above the current view, 1 searches below. nil is returned if no neighbour is found.
func (*Tree) NearestVSplit ¶
NearestVSplit returns the Tree node with the nearest vertically split neighbour view. dir argument controls the search direction; -1 searches to the left of current view, 1 searches to the right. nil is returned if no neighbour is found.
func (*Tree) SplitHorizontally ¶
func (v *Tree) SplitHorizontally()
func (*Tree) SplitVertically ¶
func (v *Tree) SplitVertically()
type View ¶
type View struct {
// contains filtered or unexported fields
}
A view is an abstract "window". It draws contents from a portion of a buffer into 'uibuf' and maintains things like cursor position.
func (*View) CursorPosition ¶
func (*View) MoveCursorTo ¶
Move cursor to the 'boffset' position in the 'line'. Obviously 'line' must be from the attached buffer. If 'boffset' < 0, use 'last_cursor_voffset'. Keep in mind that there is no need to maintain connections between lines (e.g. for moving from a deleted line to another line).
func (*View) MoveCursorToLine ¶
func (*View) MoveViewLines ¶
Move view 'n' lines forward or backward.