document

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(peer, str string, repl []Replacement) string

func RemoveMarker added in v0.0.3

func RemoveMarker(tree opTree, name string) opTree

func SplitOnMarker added in v0.0.3

func SplitOnMarker(tree opTree, name string) (opTree, opTree)

Types

type Document added in v0.0.3

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

func (*Document) Apply added in v0.0.3

func (d *Document) Apply(peer string, edits []Replacement)

func (*Document) Copy added in v0.0.3

func (d *Document) Copy() *Document

func (*Document) Edits added in v0.0.3

func (d *Document) Edits() []Replacement

append Edits that restore the original document

func (*Document) Freeze added in v0.0.3

func (d *Document) Freeze() *Document

func (*Document) Merge added in v0.0.3

func (a *Document) Merge(b *Document)

Merge operations from the same ancestor document into this one

func (*Document) OriginalString added in v0.0.3

func (d *Document) OriginalString() string

string for the original document

func (*Document) Replace added in v0.0.3

func (d *Document) Replace(peer string, start int, length int, str string)

func (*Document) ReverseEdits added in v0.0.3

func (d *Document) ReverseEdits() []Replacement

append edits that restore the original document

func (*Document) SplitOnMarker added in v0.0.3

func (d *Document) SplitOnMarker(name string) (opTree, opTree)

func (*Document) String added in v0.0.3

func (d *Document) String() string

string for the new document

type Replacement

type Replacement struct {
	Offset int
	Length int
	Text   string
}

type Set added in v0.0.2

type Set[T comparable] map[T]bool

func NewSet added in v0.0.3

func NewSet[T comparable](elements ...T) Set[T]

func (Set[T]) Add added in v0.0.3

func (m Set[T]) Add(op T) Set[T]

func (Set[T]) Has added in v0.0.3

func (m Set[T]) Has(op T) bool

func (Set[T]) Merge added in v0.0.3

func (m Set[T]) Merge(m2 Set[T]) Set[T]

func (Set[T]) Union added in v0.0.3

func (m Set[T]) Union(m2 Set[T]) Set[T]

Jump to

Keyboard shortcuts

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