core

package
v0.0.0-...-e21ce11 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const EOF = utf8.MaxRune + 1

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicBuffer

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

func (*BasicBuffer) Delete

func (bb *BasicBuffer) Delete(q0, q1 int64)

func (*BasicBuffer) End

func (bb *BasicBuffer) End() int64

func (*BasicBuffer) Insert

func (bb *BasicBuffer) Insert(q int64, s string)

func (*BasicBuffer) ReadRuneAt

func (bb *BasicBuffer) ReadRuneAt(q int64) (r rune, size int, err error)

type Buffer

type Buffer interface {
	ReadRuneAt(q int64) (r rune, size int, err error)
	Insert(q int64, s string)
	Delete(q0, q1 int64)
	End() (q int64)
}

type BytesContent

type BytesContent []byte

func (BytesContent) Bytes

func (b BytesContent) Bytes() []byte

func (BytesContent) Close

func (b BytesContent) Close() error

type Column

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

func (*Column) Close

func (col *Column) Close() error

func (*Column) MoveWindow

func (col *Column) MoveWindow(win *Window, y float64)

func (*Column) NewWindow

func (col *Column) NewWindow() *Window

func (*Column) NewWindowFile

func (col *Column) NewWindowFile(filename string) (*Window, error)

func (*Column) SetX

func (col *Column) SetX(x float64)

func (*Column) Tag

func (col *Column) Tag() *Text

func (*Column) X

func (col *Column) X() float64

type Content

type Content interface {
	Bytes() []byte
	io.Closer
}

func Mmap

func Mmap(f *os.File) (Content, error)

type Editor

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

func NewEditor

func NewEditor() *Editor

func (*Editor) Close

func (ed *Editor) Close() error

func (*Editor) MoveColumn

func (ed *Editor) MoveColumn(col *Column, x float64)

func (*Editor) NewColumn

func (ed *Editor) NewColumn() *Column

func (*Editor) SetUI

func (ed *Editor) SetUI(u ui.UI)

func (*Editor) Tag

func (ed *Editor) Tag() *Text

type Text

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

func (*Text) DeleteSel

func (t *Text) DeleteSel()

func (*Text) ExecuteUnderCursor

func (t *Text) ExecuteUnderCursor(q int64)

func (*Text) Insert

func (t *Text) Insert(s string)

func (*Text) InsertNewLine

func (t *Text) InsertNewLine()

func (*Text) MoveSel

func (t *Text) MoveSel(q int64)

func (*Text) Origin

func (t *Text) Origin() int64

func (*Text) Plumb

func (t *Text) Plumb(q int64)

func (*Text) PrevNewLine

func (t *Text) PrevNewLine(p int64, n int) int64

func (*Text) ReadRune

func (t *Text) ReadRune() (r rune, size int, err error)

func (*Text) Reset

func (t *Text) Reset()

func (*Text) Select

func (t *Text) Select(q0, q1 int64)

func (*Text) SelectUnderCursor

func (t *Text) SelectUnderCursor(q int64)

func (*Text) Selected

func (t *Text) Selected() (q0, q1 int64)

func (*Text) SelectionToString

func (t *Text) SelectionToString(q0, q1 int64) string

func (*Text) SetOrigin

func (t *Text) SetOrigin(org int64)

func (*Text) StartSel

func (t *Text) StartSel(q int64)

func (*Text) StopSel

func (t *Text) StopSel()

type UndoBuffer

type UndoBuffer struct {
	*undo.Buffer
	// contains filtered or unexported fields
}

func NewUndoBuffer

func NewUndoBuffer(buf *undo.Buffer) *UndoBuffer

func (*UndoBuffer) Delete

func (b *UndoBuffer) Delete(q0, q1 int64)

func (*UndoBuffer) End

func (b *UndoBuffer) End() int64

func (*UndoBuffer) FindRange

func (b *UndoBuffer) FindRange(off, n int64) (q0, q1 int64)

func (*UndoBuffer) Insert

func (b *UndoBuffer) Insert(q int64, s string)

func (*UndoBuffer) ReadRuneAt

func (b *UndoBuffer) ReadRuneAt(pos int64) (r rune, size int, err error)

func (*UndoBuffer) Redo

func (b *UndoBuffer) Redo() (q0, q1 int64)

func (*UndoBuffer) RuneReaderFrom

func (b *UndoBuffer) RuneReaderFrom(q int64) (r io.RuneReader, off int64)

RuneReaderFrom returns an io.RuneReader and the offset in bytes that corresponds to q.

func (*UndoBuffer) Undo

func (b *UndoBuffer) Undo() (q0, q1 int64)

type Window

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

func (*Window) Body

func (win *Window) Body() *Text

func (*Window) Close

func (win *Window) Close() error

func (*Window) Dirty

func (win *Window) Dirty() bool

func (*Window) SetFilename

func (win *Window) SetFilename(filename string)

func (*Window) SetY

func (win *Window) SetY(y float64)

func (*Window) Tag

func (win *Window) Tag() *Text

func (*Window) Write

func (win *Window) Write(b []byte) (n int, err error)

func (*Window) Y

func (win *Window) Y() float64

Jump to

Keyboard shortcuts

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