tf

package module
v0.0.0-...-5245216 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 2 Imported by: 3

README

tf

text agnostic interface

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float

func Float(r rune) (insert bool)

func Integer

func Integer(r rune) (insert bool)

func UnsignedInteger

func UnsignedInteger(r rune) (insert bool)

Types

type Buffer

type Buffer [][]rune

func (*Buffer) Cursor

func (b *Buffer) Cursor(row, col uint)

func (*Buffer) Drawer

func (b *Buffer) Drawer(row, col uint, r rune)

func (Buffer) ErrorRune

func (b Buffer) ErrorRune() bool

func (Buffer) HasCursor

func (b Buffer) HasCursor() bool

func (Buffer) String

func (b Buffer) String() string

func (Buffer) Text

func (b Buffer) Text() string

type Format

type Format uint8

type TextField

type TextField struct {
	Filter func(r rune) (insert bool)
	// contains filtered or unexported fields
}

func (*TextField) CursorMoveDown

func (t *TextField) CursorMoveDown()

func (*TextField) CursorMoveLeft

func (t *TextField) CursorMoveLeft()

func (*TextField) CursorMoveRight

func (t *TextField) CursorMoveRight()

func (*TextField) CursorMoveUp

func (t *TextField) CursorMoveUp()

func (*TextField) CursorPosition

func (t *TextField) CursorPosition(row, col uint)

func (*TextField) GetRenderHeight

func (t *TextField) GetRenderHeight() (h uint)

func (*TextField) GetRenderWidth

func (t *TextField) GetRenderWidth() uint

func (TextField) GetText

func (t TextField) GetText() []rune

func (*TextField) Insert

func (t *TextField) Insert(r rune)

Insert rune, key Enter `\n` in text without update buffer. After that function run `SetWidth` for update buffer.

func (*TextField) KeyBackspace

func (t *TextField) KeyBackspace()

func (*TextField) KeyDel

func (t *TextField) KeyDel()

func (*TextField) Render

func (t *TextField) Render(
	drawer func(row, col uint, r rune),
	cursor func(row, col uint),
) (height uint)

func (*TextField) SetText

func (t *TextField) SetText(text []rune)

func (*TextField) SetWidth

func (t *TextField) SetWidth(width uint)

runewidth is ignored.

runes '\t', '\v', '\f', '\r', U+0085 (NEL), U+00A0 (NBSP) are iterpreted as '\n'.

function is panic free.

type TextFieldLimit

type TextFieldLimit struct {
	TextField
	// contains filtered or unexported fields
}

func (*TextFieldLimit) GetRenderHeight

func (t *TextFieldLimit) GetRenderHeight() (h uint)

func (*TextFieldLimit) Render

func (t *TextFieldLimit) Render(
	drawer func(row, col uint, r rune),
	cursor func(row, col uint),
) (height uint)

func (*TextFieldLimit) SetLinesLimit

func (t *TextFieldLimit) SetLinesLimit(lines uint)

Jump to

Keyboard shortcuts

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