view

package
v0.0.0-...-2ab8766 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

func (s Selection) EffectiveRange() (r buffer.Range)

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 NewTag

func NewTag(startLine, startOffset, endLine, endOffset int, fg, bg termbox.Attribute) Tag

func (*Tag) AdjustEndLine

func (t *Tag) AdjustEndLine(count int)

func (*Tag) AdjustEndOffset

func (t *Tag) AdjustEndOffset(count int)

func (*Tag) AdjustStartLine

func (t *Tag) AdjustStartLine(count int)

func (*Tag) AdjustStartOffset

func (t *Tag) AdjustStartOffset(count int)

func (*Tag) EndPos

func (t *Tag) EndPos() (int, int)

func (*Tag) FlipStartAndEndLines

func (t *Tag) FlipStartAndEndLines()

func (*Tag) FlipStartAndEndOffsets

func (t *Tag) FlipStartAndEndOffsets()

func (*Tag) SetEndOffset

func (t *Tag) SetEndOffset(e int)

func (*Tag) SetStartOffset

func (t *Tag) SetStartOffset(s int)

func (*Tag) StartPos

func (t *Tag) StartPos() (int, int)

type Tree

type Tree struct {
	tulib.Rect // updated with 'resize' call
	// contains filtered or unexported fields
}

func NewTree

func NewTree(v *View) *Tree

func NewTreeLeaf

func NewTreeLeaf(parent *Tree, v *View) *Tree

func (*Tree) Bottom

func (t *Tree) Bottom() *Tree

func (*Tree) Draw

func (v *Tree) Draw()

func (*Tree) FirstLeafNode

func (v *Tree) FirstLeafNode() *Tree

func (*Tree) Leaf

func (t *Tree) Leaf() *View

func (*Tree) Left

func (t *Tree) Left() *Tree

func (*Tree) NearestHSplit

func (v *Tree) NearestHSplit(dir int) *Tree

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

func (v *Tree) NearestVSplit(dir int) *Tree

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

func (t *Tree) NewLeaf(v *View) *Tree

func (*Tree) Parent

func (t *Tree) Parent() *Tree

func (*Tree) Reparent

func (v *Tree) Reparent(parent *Tree)

func (*Tree) Resize

func (v *Tree) Resize(pos tulib.Rect)

func (*Tree) Right

func (t *Tree) Right() *Tree

func (*Tree) SetParent

func (t *Tree) SetParent(parent *Tree)

func (*Tree) Sibling

func (v *Tree) Sibling() *Tree

func (*Tree) SplitHorizontally

func (v *Tree) SplitHorizontally()

func (*Tree) SplitVertically

func (v *Tree) SplitVertically()

func (*Tree) Top

func (t *Tree) Top() *Tree

func (*Tree) Walk

func (v *Tree) Walk(cb func(*Tree))

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 NewView

func NewView(ctx Context, buf *buffer.Buffer, redraw chan struct{}) *View

func (*View) Attach

func (v *View) Attach(b *buffer.Buffer)

func (*View) Buffer

func (v *View) Buffer() *buffer.Buffer

func (View) Cursor

func (l View) Cursor() buffer.Cursor

func (*View) CursorPosition

func (v *View) CursorPosition() (int, int)

func (*View) Detach

func (v *View) Detach()

func (*View) MoveCursorTo

func (v *View) MoveCursorTo(c buffer.Cursor)

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 (v *View) MoveCursorToLine(n int)

func (*View) MoveViewLines

func (v *View) MoveViewLines(n int)

Move view 'n' lines forward or backward.

func (*View) Selection

func (v *View) Selection() Selection

func (*View) SetHighlightBytes

func (v *View) SetHighlightBytes(b []byte)

func (*View) SetSelection

func (v *View) SetSelection(r Selection)

func (*View) SetStatus

func (v *View) SetStatus(format string, args ...interface{})

SetStatus sets the status line of the view

func (*View) ShowHighlights

func (v *View) ShowHighlights(b bool)

func (*View) UIBuf

func (v *View) UIBuf() tulib.Buffer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL