eit

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitScreen

func InitScreen() tcell.Screen

Types

type Buffer

type Buffer struct {
	// current cursor
	CurrCursor *Cursor

	// []rune just equivalent of one line, and a rune is a rune.
	Runes [][]rune

	// how many lines of buffer, start with 0
	Lines int

	Config *Config
}

content of screen

func NewBuffer

func NewBuffer(config *Config) (buf *Buffer, err error)

func (*Buffer) AddLine

func (buffer *Buffer) AddLine(line []rune)

func (*Buffer) Delete

func (buffer *Buffer) Delete()

func (*Buffer) DeleteLine

func (buffer *Buffer) DeleteLine()

func (*Buffer) Draw

func (buffer *Buffer) Draw(screen tcell.Screen)

func (*Buffer) InsertRune

func (buffer *Buffer) InsertRune(r rune)

Insert a rune behind current cursor

func (*Buffer) IsEmpty

func (buffer *Buffer) IsEmpty() bool

Is current buffer empty

func (*Buffer) LoadFromFile

func (buffer *Buffer) LoadFromFile(filepath string) error

func (*Buffer) NewLine

func (buffer *Buffer) NewLine()

func (*Buffer) SaveAs

func (buffer *Buffer) SaveAs() (err error)

func (*Buffer) String

func (buffer *Buffer) String() string

type Config

type Config struct {
	ShowLineNumber  bool
	SyntaxHighlight bool
	FilePath        string
}

type Cursor

type Cursor struct {
	X, Y   int
	Buffer *Buffer
}

The cursor position

func (*Cursor) AtBeginOfLine

func (cursor *Cursor) AtBeginOfLine() bool

func (*Cursor) AtEndOfLine

func (cursor *Cursor) AtEndOfLine() bool

at line end

func (*Cursor) AtFirstLineOfBuffer

func (cursor *Cursor) AtFirstLineOfBuffer() bool

func (*Cursor) AtLastLineOfBuffer

func (cursor *Cursor) AtLastLineOfBuffer() bool

at the last line of buffer

func (*Cursor) IsLastPoint

func (cursor *Cursor) IsLastPoint() bool

cursor at buffer last point

func (*Cursor) IsOriginPoint

func (cursor *Cursor) IsOriginPoint() bool

cursor at (0, 0) point

func (*Cursor) MoveDown

func (cursor *Cursor) MoveDown()

func (*Cursor) MoveLeft

func (cursor *Cursor) MoveLeft()

Move cursor left

func (*Cursor) MovePrevLine

func (cursor *Cursor) MovePrevLine()

func (*Cursor) MoveRight

func (cursor *Cursor) MoveRight()

func (*Cursor) MoveUp

func (cursor *Cursor) MoveUp()

func (*Cursor) NewLine

func (cursor *Cursor) NewLine()

Jump to

Keyboard shortcuts

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