views

package
v0.0.0-...-74c0925 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 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 Document

type Document struct {
	Rows Rows
	// contains filtered or unexported fields
}

func LoadDocument

func LoadDocument(filenames ...string) (*Document, error)

LoadDocument todo 暂时只加载一个 document is never null.

func NewDocument

func NewDocument() *Document

func (*Document) Height

func (d *Document) Height() int

Height get document Rows len.

func (*Document) InsertRune

func (d *Document) InsertRune(r rune, row int, col int)

InsertRune insert rune at specified row and column

func (*Document) Length

func (d *Document) Length() int

Length Value returns the value of the text input.

func (*Document) Load

func (d *Document) Load(filename string) error

func (*Document) Render

func (d *Document) Render() string

func (*Document) Row

func (d *Document) Row(i int) Row

Row get row by index

func (*Document) SplitLine

func (d *Document) SplitLine(row int, col int)

func (*Document) String

func (d *Document) String() string

type Row

type Row []rune

func (Row) Col

func (r Row) Col(col int) rune

func (Row) RuneWidth

func (r Row) RuneWidth(col int) int

func (Row) String

func (r Row) String() string

func (Row) TotalRuneWidth

func (r Row) TotalRuneWidth() int

type Rows

type Rows []Row

func NewRows

func NewRows(data []byte) (Rows, error)

func (Rows) Has

func (rs Rows) Has(row int) bool

func (Rows) InsertRune

func (rs Rows) InsertRune(r rune, row int, col int)

func (Rows) Len

func (rs Rows) Len() int

Len get row len

func (Rows) NewLine

func (rs Rows) NewLine() Rows

func (Rows) Row

func (rs Rows) Row(idx int) Row

Row get row by idx

func (Rows) SplitLine

func (rs Rows) SplitLine(row int, col int)

func (Rows) String

func (rs Rows) String() string

func (Rows) TotalSize

func (rs Rows) TotalSize() int

TotalSize get rune total width.

Jump to

Keyboard shortcuts

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