codeeditor

package
v0.0.0-...-4d9c9a1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cursor

type Cursor struct {
	Row int
	Col int
}

type Editor

type Editor struct {
	Cursor Cursor
	// TODO: linked list is better here
	Lines []string
}

func New

func New(text string) *Editor

func (*Editor) BackwardDeleteChar

func (editor *Editor) BackwardDeleteChar()

func (*Editor) CharAtCursor

func (editor *Editor) CharAtCursor() string

func (*Editor) Column

func (editor *Editor) Column() int

func (*Editor) InsertChar

func (editor *Editor) InsertChar(r rune)

FIXME: maybe method modify line

func (*Editor) IsBeginningOfFile

func (editor *Editor) IsBeginningOfFile() bool

func (*Editor) IsBeginningOfLine

func (editor *Editor) IsBeginningOfLine() bool

func (*Editor) IsEndOfFile

func (editor *Editor) IsEndOfFile() bool

func (*Editor) IsEndOfLine

func (editor *Editor) IsEndOfLine() bool

func (*Editor) MoveCursorToEndOfLine

func (editor *Editor) MoveCursorToEndOfLine()

func (*Editor) MoveCursorToStartOfLine

func (editor *Editor) MoveCursorToStartOfLine()

func (*Editor) MoveToLeft

func (editor *Editor) MoveToLeft()

func (*Editor) MoveToNextLine

func (editor *Editor) MoveToNextLine()

func (*Editor) MoveToPrevLine

func (editor *Editor) MoveToPrevLine()

func (*Editor) MoveToRight

func (editor *Editor) MoveToRight(n int)

func (*Editor) NewLine

func (editor *Editor) NewLine()

NewLine adds new line at cursor point. Usually happens on pressing return key.

func (*Editor) Row

func (editor *Editor) Row() int

func (*Editor) Text

func (editor *Editor) Text() string

Jump to

Keyboard shortcuts

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