vidar: github.com/nelsam/vidar/command/history Index | Files

package history

import "github.com/nelsam/vidar/command/history"

Index

Package Files

atomics.go history.go undo_redo.go

func Bindables Uses

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.

type Applier Uses

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

type History Uses

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

History keeps track of change history for a file.

func (*History) Apply Uses

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

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

func (*History) Branches Uses

func (h *History) Branches() uint

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

func (*History) FastForward Uses

func (h *History) FastForward(branch uint) input.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 Uses

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

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

func (*History) Init Uses

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

Init implements input.ChangeHook

func (*History) Name Uses

func (h *History) Name() string

Name returns the name of h

func (*History) OpNames Uses

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

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

func (*History) Rewind Uses

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

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

func (*History) TextChanged Uses

func (h *History) TextChanged(_ input.Editor, e input.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 Uses

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

func (OnOpen) FileBindables Uses

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

func (OnOpen) Name Uses

func (o OnOpen) Name() string

func (OnOpen) OpName Uses

func (o OnOpen) OpName() string

type Redo Uses

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

A Redo is a command which redoes an action.

func (*Redo) Defaults Uses

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

func (*Redo) Exec Uses

func (r *Redo) Exec() error

func (*Redo) Menu Uses

func (r *Redo) Menu() string

func (*Redo) Name Uses

func (r *Redo) Name() string

func (*Redo) Reset Uses

func (r *Redo) Reset()

func (*Redo) Store Uses

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

type Undo Uses

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

An Undo is a command which undoes an action.

func (*Undo) Defaults Uses

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

func (*Undo) Exec Uses

func (u *Undo) Exec() error

func (*Undo) Menu Uses

func (u *Undo) Menu() string

func (*Undo) Name Uses

func (u *Undo) Name() string

func (*Undo) Reset Uses

func (u *Undo) Reset()

func (*Undo) Store Uses

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

Package history imports 10 packages (graph) and is imported by 1 packages. Updated 2019-09-15. Refresh now. Tools for package owners.