interfaces

package
v0.0.0-...-5ea6b8d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMode

func AddMode(name string, m EditorModeFactory)

func SetApplication

func SetApplication(ap2 Application)

func SetBufferFactory

func SetBufferFactory(bf BufferFactory)

func SetClipboardProvider

func SetClipboardProvider(bf ClipboardProvider)

Types

type Application

type Application interface {
	Windows() []Window
	CreateWindow(string, string) Window
	FindWindow(Window) Window
	KillWindow(Window)
}

func GetApplication

func GetApplication() Application

type Buffer

type Buffer interface {
	Mode() EditorMode
	GetLines() *linearray.LineArray
	Point() linearray.Loc
	Mark() linearray.Loc
	SetPoint(linearray.Loc)
	SetMark(linearray.Loc)
	ScrollPosition() int
	SetScrollPosition(int)
	LinesInDisplay() int
	SetLinesInDisplay(int)
	TakeSnapshot(bool)
	Undo()
	Redo()
}

type BufferFactory

type BufferFactory interface {
	NewScratchBuffer() Buffer
}

func GetBufferFactory

func GetBufferFactory() BufferFactory

type Clipboard

type Clipboard interface {
	GetData() string
	SetData(string)
}

type ClipboardProvider

type ClipboardProvider interface {
	Get() Clipboard
}

func GetClipboardProvider

func GetClipboardProvider() ClipboardProvider

type Command

type Command interface {
	Aliases() []string
	Execute(Window, []string) error
	Complete(Window, []string) []string
}

type Commands

type Commands map[string]Command

func NewCommands

func NewCommands() *Commands

func (*Commands) ExecuteCommand

func (cmds *Commands) ExecuteCommand(win Window, args []string) error

func (*Commands) GetCompletions

func (cmds *Commands) GetCompletions(win Window, cmd string) []string

func (*Commands) Names

func (cmds *Commands) Names() []string

func (*Commands) Register

func (cmds *Commands) Register(cmd Command)

type EditorMode

type EditorMode interface {
	Name() string
	ExecuteCommand(w Window, key *input.KeyPressInfo) error
	GetBufferStyle() *theme.BufferThemeStyle
	GetLineStyle(int) *theme.LineThemeStyle
	GetCharacterStyle(int, int) *theme.CharacterThemeStyle
}

func GetMode

func GetMode(name string) EditorMode

type EditorModeFactory

type EditorModeFactory interface {
	Create() EditorMode
}

type NoSuchCommand

type NoSuchCommand string

func (NoSuchCommand) Error

func (err NoSuchCommand) Error() string

type Window

type Window interface {
	OpenBuffer() Buffer
	Clipboard() Clipboard
}

Jump to

Keyboard shortcuts

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