editor

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmdline

type Cmdline interface {
	Init(chan<- event.Event, <-chan event.Event, chan<- struct{})
	Run()
	Get() ([]rune, int, []string, int)
}

Cmdline defines the required cmdline interface for the editor.

type Editor

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

Editor is the main struct for this command.

func NewEditor

func NewEditor(ui UI, wm Manager, cmdline Cmdline) *Editor

NewEditor creates a new editor.

func (*Editor) Close

func (e *Editor) Close() error

Close terminates the editor.

func (*Editor) Init

func (e *Editor) Init() error

Init initializes the editor.

func (*Editor) Open

func (e *Editor) Open(filename string) (err error)

Open opens a new file.

func (*Editor) OpenEmpty

func (e *Editor) OpenEmpty() (err error)

OpenEmpty creates a new window.

func (*Editor) Run

func (e *Editor) Run() error

Run the editor.

type Manager

type Manager interface {
	Init(chan<- event.Event, chan<- struct{})
	Open(string) error
	SetSize(int, int)
	Resize(int, int)
	Emit(event.Event)
	State() (map[int]*state.WindowState, layout.Layout, int, error)
	Close()
}

Manager defines the required window manager interface for the editor.

type UI

type UI interface {
	Init(chan<- event.Event) error
	Run(map[mode.Mode]*key.Manager)
	Size() (int, int)
	Redraw(state.State) error
	Close() error
}

UI defines the required user interface for the editor.

Jump to

Keyboard shortcuts

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