Documentation
¶
Index ¶
- func Apply(peer, str string, repl []Replacement) string
- func As[T any](v any) T
- func Changes(prefix string, ops OpTree) string
- func Isa[T any](v any) bool
- func OpString(tree OpTree, verbose ...bool) string
- func SplitNew(tree OpTree, offset int) (OpTree, OpTree)
- func SplitOld(tree OpTree, offset int) (OpTree, OpTree)
- func SplitOnMarker(tree OpTree, name string) (OpTree, OpTree)
- type Document
- func (d *Document) Apply(peer string, edits []Replacement)
- func (d *Document) Changes(prefix string) string
- func (d *Document) Copy() *Document
- func (d *Document) Edits() []Replacement
- func (d *Document) Freeze() *Document
- func (d *Document) Mark(peer, name string, offset int)
- func (d *Document) Merge(b *Document)
- func (d *Document) OpString(verbose ...bool) string
- func (d *Document) OriginalString() string
- func (d *Document) Replace(peer string, start int, length int, str string)
- func (d *Document) ReverseEdits() []Replacement
- func (d *Document) Simplify()
- func (d *Document) SplitOnMarker(name string) (OpTree, OpTree)
- func (d *Document) String() string
- type InsertOp
- type MarkerOp
- type Measure
- type Merger
- type OpMeasurer
- type OpTree
- type Operation
- type Replacement
- type RetainOp
- type Set
- type SkipOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(peer, str string, repl []Replacement) string
Types ¶
type Document ¶ added in v0.0.3
type Document struct {
Ops OpTree
}
func NewDocument ¶ added in v0.0.4
func (*Document) Apply ¶ added in v0.0.3
func (d *Document) Apply(peer string, edits []Replacement)
func (*Document) Edits ¶ added in v0.0.3
func (d *Document) Edits() []Replacement
append Edits that restore the original document
func (*Document) Merge ¶ added in v0.0.3
Merge another version of the original document into this one
func (*Document) OriginalString ¶ added in v0.0.3
string for the original document
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
type OpMeasurer ¶ added in v0.0.4
type OpMeasurer bool
func (OpMeasurer) Identity ¶ added in v0.0.4
func (m OpMeasurer) Identity() Measure
func (OpMeasurer) Measure ¶ added in v0.0.4
func (m OpMeasurer) Measure(op Operation) Measure
type OpTree ¶ added in v0.0.6
type OpTree = ft.FingerTree[OpMeasurer, Operation, Measure]
func RemoveMarker ¶ added in v0.0.3
type Replacement ¶
type RetainOp ¶ added in v0.0.4
type RetainOp struct {
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]
Click to show internal directories.
Click to hide internal directories.