tview

package
v0.0.0-...-66ecaaf Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MarkdownView

type MarkdownView struct {
	sync.Mutex
	*tview.Box
	// contains filtered or unexported fields
}

func NewMarkdownView

func NewMarkdownView(theme *chroma.Style) *MarkdownView

func (*MarkdownView) Clear

func (mv *MarkdownView) Clear() *MarkdownView

Clear removes all text from the buffer.

func (*MarkdownView) Draw

func (mv *MarkdownView) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*MarkdownView) Focus

func (mv *MarkdownView) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*MarkdownView) GetMarkdown

func (mv *MarkdownView) GetMarkdown() []byte

func (*MarkdownView) HasFocus

func (mv *MarkdownView) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*MarkdownView) InputHandler

func (mv *MarkdownView) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (*MarkdownView) SelectAnchor

func (mv *MarkdownView) SelectAnchor(anchor string) bool

SelectAnchor selects the next heading with the given anchor.

func (*MarkdownView) SelectNext

func (mv *MarkdownView) SelectNext(selector Selector) bool

SelectNext selects the first node after the current selection that matches the given selector.

func (*MarkdownView) SelectPrevious

func (mv *MarkdownView) SelectPrevious(selector Selector) bool

SelectPrevious selects the first node before the current selection that matches the given selector.

func (*MarkdownView) SelectSpan

func (mv *MarkdownView) SelectSpan(span *renderer.NodeSpan, highlight bool)

SelectSpan selects the given node span.

func (*MarkdownView) Selection

func (mv *MarkdownView) Selection() *renderer.NodeSpan

func (*MarkdownView) SetGutter

func (mv *MarkdownView) SetGutter(showGutter bool) *MarkdownView

SetGutter sets the gutter flag, that, if true, instructs the view to render a gutter in its bottommost line with the document name and view position.

func (*MarkdownView) SetText

func (mv *MarkdownView) SetText(name, markdown string) *MarkdownView

SetText sets the text of this text view to the provided string. Previously contained text will be removed.

func (*MarkdownView) SetWrap

func (mv *MarkdownView) SetWrap(wrap bool) *MarkdownView

SetWrap sets the flag that, if true, leads to lines that are longer than the available width being wrapped onto the next line. If false, any characters beyond the available width are not displayed.

type Selector

type Selector func(n ast.Node) (highlight, ok bool)

Jump to

Keyboard shortcuts

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