editor

package module
v0.0.0-...-1b85255 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 7 Imported by: 1

README

Go Text Editor (WIP)

An monospace text editor API. Handles all of the editing logic except for reading user input and rendering.

Written specifically for go-mitizen, but usable for any other project.

Documentation

Index

Constants

View Source
const (
	DefaultWidth = 80
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TextEditor

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

func NewEditor

func NewEditor() *TextEditor

NewEditor create a new empty text editor.

func (*TextEditor) Backspace

func (t *TextEditor) Backspace()

func (*TextEditor) CurParagraph

func (t *TextEditor) CurParagraph() paragraph

func (*TextEditor) CurParagraphLength

func (t *TextEditor) CurParagraphLength() int

func (*TextEditor) CursorColumn

func (t *TextEditor) CursorColumn() int

func (*TextEditor) CursorIndex

func (t *TextEditor) CursorIndex() int

func (*TextEditor) CursorIsAtEndOfParagraph

func (t *TextEditor) CursorIsAtEndOfParagraph() bool

func (*TextEditor) CursorIsAtStartOfParagraph

func (t *TextEditor) CursorIsAtStartOfParagraph() bool

func (*TextEditor) CursorIsOnFirstParagraph

func (t *TextEditor) CursorIsOnFirstParagraph() bool

func (*TextEditor) CursorIsOnLastParagraph

func (t *TextEditor) CursorIsOnLastParagraph() bool

func (*TextEditor) CursorRow

func (t *TextEditor) CursorRow() int

func (*TextEditor) Down

func (t *TextEditor) Down()

func (*TextEditor) DownNum

func (t *TextEditor) DownNum(n int)

func (*TextEditor) Empty

func (t *TextEditor) Empty() bool

func (*TextEditor) End

func (t *TextEditor) End()

func (*TextEditor) Home

func (t *TextEditor) Home()

func (*TextEditor) IsEmpty

func (t *TextEditor) IsEmpty() bool

func (*TextEditor) Left

func (t *TextEditor) Left()

func (*TextEditor) LeftNum

func (t *TextEditor) LeftNum(n int)

func (*TextEditor) Newline

func (t *TextEditor) Newline()

func (*TextEditor) NumGraphemes

func (t *TextEditor) NumGraphemes() int

func (*TextEditor) NumParagraphs

func (t *TextEditor) NumParagraphs() int

func (*TextEditor) Paragraphs

func (t *TextEditor) Paragraphs() []string

func (*TextEditor) Right

func (t *TextEditor) Right()

func (*TextEditor) RightNum

func (t *TextEditor) RightNum(n int)

func (*TextEditor) SetFirstLineIndent

func (t *TextEditor) SetFirstLineIndent(newFirstLineIndent int)

func (*TextEditor) SetWidth

func (t *TextEditor) SetWidth(newWidth int)

func (*TextEditor) String

func (t *TextEditor) String() string

func (*TextEditor) Up

func (t *TextEditor) Up()

func (*TextEditor) UpNum

func (t *TextEditor) UpNum(n int)

func (*TextEditor) Write

func (t *TextEditor) Write(text string)

Jump to

Keyboard shortcuts

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