rwundo

package
v2.0.0-...-7f6935a Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edits

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

func (*Edits) Append

func (edits *Edits) Append(ur *UndoRedo)

func (*Edits) Empty

func (edits *Edits) Empty() bool

func (*Edits) Entries

func (edits *Edits) Entries() []*UndoRedo

func (*Edits) MergeEdits

func (edits *Edits) MergeEdits(edits2 *Edits)

func (*Edits) WriteUndoRedo

func (edits *Edits) WriteUndoRedo(redo bool, w iorw.WriterAt) (rwedit.SimpleCursor, error)

type HList

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

func NewHList

func NewHList() *HList

func (*HList) Append

func (hl *HList) Append(edits *Edits, maxLen int)

func (*HList) Clear

func (hl *HList) Clear()

func (*HList) ClearUndones

func (hl *HList) ClearUndones()

func (*HList) DoneBack

func (hl *HList) DoneBack() *list.Element

func (*HList) NDoneBack

func (hl *HList) NDoneBack(n int) ([]*Edits, []*list.Element)

func (*HList) Redo

func (hl *HList) Redo(peek bool) (*Edits, bool)

func (*HList) Undo

func (hl *HList) Undo(peek bool) (*Edits, bool)

type History

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

func NewHistory

func NewHistory(maxLen int) *History

func (*History) Append

func (h *History) Append(edits *Edits)

func (*History) BeginUndoGroup

func (h *History) BeginUndoGroup(c rwedit.SimpleCursor)

func (*History) Clear

func (h *History) Clear()

func (*History) ClearUndones

func (h *History) ClearUndones()

func (*History) EndUndoGroup

func (h *History) EndUndoGroup(c rwedit.SimpleCursor)

func (*History) UndoRedo

func (h *History) UndoRedo(redo, peek bool) (*Edits, bool)

type RWUndo

type RWUndo struct {
	iorw.ReadWriterAt
	History *History
}

func NewRWUndo

func NewRWUndo(rw iorw.ReadWriterAt, hist *History) *RWUndo

func (*RWUndo) OverwriteAt

func (rw *RWUndo) OverwriteAt(i, n int, p []byte) error

func (*RWUndo) UndoRedo

func (rw *RWUndo) UndoRedo(redo, peek bool) (rwedit.SimpleCursor, bool, error)

type UndoRedo

type UndoRedo struct {
	Index int
	D     []byte // deleted bytes of the original op
	I     []byte // inserted bytes of the original op
}

func NewUndoRedoOverwrite

func NewUndoRedoOverwrite(rw iorw.ReadWriterAt, i, n int, p []byte) (*UndoRedo, error)

func (*UndoRedo) Apply

func (ur *UndoRedo) Apply(redo bool, w iorw.WriterAt) error

func (*UndoRedo) IsDeleteOnly

func (ur *UndoRedo) IsDeleteOnly() bool

func (*UndoRedo) IsInsertOnly

func (ur *UndoRedo) IsInsertOnly() bool

Jump to

Keyboard shortcuts

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