ui

package
v0.0.0-...-1b962b3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor struct {
	CancelFunc func()
	AcceptFunc func()
	// contains filtered or unexported fields
}

Editor is a simple component that wraps tview.TextView in order to gove the user minimal text edit functionality.

func NewEditor

func NewEditor() *Editor

NewEditor Instanciates a ready to use text editor.

func (*Editor) GetCurrentMentionIndices

func (editor *Editor) GetCurrentMentionIndices() (int, int)

GetCurrentMentionIndices gets the starting and ending indices of the input box text which are to be replaced

func (*Editor) GetFormItem

func (editor *Editor) GetFormItem() tview.FormItem

func (*Editor) GetPrimitive

func (editor *Editor) GetPrimitive() tview.Primitive

GetPrimitive returnbs the internal component that can be added to a layout

func (*Editor) GetRequestedHeight

func (editor *Editor) GetRequestedHeight() int

GetRequestedHeight returns the currently requested size.

func (*Editor) GetText

func (editor *Editor) GetText() string

GetText returns the text without color tags, region tags and so on.

func (*Editor) SetBackgroundColor

func (editor *Editor) SetBackgroundColor(color tcell.Color)

SetBackgroundColor sets the background color of the internal TextView

func (*Editor) SetInputCapture

func (editor *Editor) SetInputCapture(captureFunc func(event *tcell.EventKey) *tcell.EventKey)

SetInputCapture sets the alternative input capture that will be used if the components default controls aren't being triggered.

func (*Editor) SetMentionHideHandler

func (editor *Editor) SetMentionHideHandler(handlerFunc func())

SetMentionHideHandler sets the handler for when a mention is no longer being requested

func (*Editor) SetMentionShowHandler

func (editor *Editor) SetMentionShowHandler(handlerFunc func(namePart string))

SetMentionShowHandler sets the handler for when a mention is being requested

func (*Editor) SetOnHeightChangeRequest

func (editor *Editor) SetOnHeightChangeRequest(handler func(requestHeight int))

SetOnHeightChangeRequest handles the cases where the component thinks it needs more space or would be fine with less.

func (*Editor) SetText

func (editor *Editor) SetText(text string)

SetText sets the texts of the internal TextView, but also sets the selection and necessary groups for the navigation behaviour.

type NonotaUI

type NonotaUI struct {
	// contains filtered or unexported fields
}

func New

func New(board *nonota.Board, filename string, refTime time.Time) *NonotaUI

func (*NonotaUI) Run

func (ui *NonotaUI) Run() error

Jump to

Keyboard shortcuts

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