history

package
v0.0.0-...-bbcbdef Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bindables

func Bindables(_ command.Commander, _ gxui.Driver, theme *basic.Theme) []bind.Bindable

Bindables returns the slice of bind.Bindable types that is implemented by this package.

Types

type Applier

type Applier interface {
	Apply(text.Editor, ...text.Edit)
}

type History

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

History keeps track of change history for a file.

func (*History) Apply

func (h *History) Apply(text.Editor) error

Apply is unused on history - recording the changes is all that is needed.

func (*History) Branches

func (h *History) Branches() uint

Branches returns the number of branches available to fast forward to at the current branch.

func (*History) FastForward

func (h *History) FastForward(branch uint) text.Edit

FastForward moves h's state forward in the history, based on branch. To fast forward the most recent undo, run h.FastForward(h.Branches() - 1).

func (*History) FileChanged

func (h *History) FileChanged(oldPath, newPath string)

FileChanged updates the current history when the focused file is changed.

func (*History) Init

func (h *History) Init(text.Editor, []rune)

Init implements input.ChangeHook

func (*History) Name

func (h *History) Name() string

Name returns the name of h

func (*History) OpNames

func (h *History) OpNames() []string

OpNames returns the name of bind.Op types that h needs to bind to.

func (*History) Rewind

func (h *History) Rewind() text.Edit

Rewind tells h to rewind its current state and return the text.Edit that needs to be applied in order to rewind the text to its previous state.

func (*History) TextChanged

func (h *History) TextChanged(_ text.Editor, e text.Edit)

TextChanged hooks into the input handler to trigger off of changes in the editor so that h can track the history of those changes.

type OnOpen

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

func (OnOpen) FileBindables

func (o OnOpen) FileBindables(string) []bind.Bindable

func (OnOpen) Name

func (o OnOpen) Name() string

func (OnOpen) OpName

func (o OnOpen) OpName() string

type Redo

type Redo struct {
	status.General
	// contains filtered or unexported fields
}

A Redo is a command which redoes an action.

func (*Redo) Defaults

func (r *Redo) Defaults() []fmt.Stringer

func (*Redo) Exec

func (r *Redo) Exec() error

func (*Redo) Menu

func (r *Redo) Menu() string

func (*Redo) Name

func (r *Redo) Name() string

func (*Redo) Reset

func (r *Redo) Reset()

func (*Redo) Store

func (r *Redo) Store(target interface{}) bind.Status

type Undo

type Undo struct {
	status.General
	// contains filtered or unexported fields
}

An Undo is a command which undoes an action.

func (*Undo) Defaults

func (u *Undo) Defaults() []fmt.Stringer

func (*Undo) Exec

func (u *Undo) Exec() error

func (*Undo) Menu

func (u *Undo) Menu() string

func (*Undo) Name

func (u *Undo) Name() string

func (*Undo) Reset

func (u *Undo) Reset()

func (*Undo) Store

func (u *Undo) Store(target interface{}) bind.Status

Jump to

Keyboard shortcuts

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