func (p *TextProxy) Edit(from, to int, content string) *TextProxy {
	if from > to {
		panic("from should be less than or equal to to")
	}
	fromPos, toPos := p.Text.CreateRange(from, to)
	if log.Core.Enabled(zap.DebugLevel) {
		log.Logger.Debugf(
			"EDIT: f:%d->%s, t:%d->%s c:%s",
			from, fromPos.AnnotatedString(), to, toPos.AnnotatedString(), content,
		)
	}
	ticket := p.context.IssueTimeTicket()
	_, maxCreationMapByActor := p.Text.Edit(
		fromPos,
		toPos,
		nil,
		content,
		ticket,
	)
	p.context.Push(operation.NewEdit(
		p.CreatedAt(),
		fromPos,
		toPos,
		maxCreationMapByActor,
		content,
		ticket,
	))
	if fromPos.Compare(toPos) != 0 {
		p.context.RegisterRemovedNodeTextElement(p)
	}
	return p
}
Edit edits the given range with the given content.
package proxy
import (
	"go.uber.org/zap"
	"github.com/yorkie-team/yorkie/internal/log"
	"github.com/yorkie-team/yorkie/pkg/document/change"
	"github.com/yorkie-team/yorkie/pkg/document/json"
	"github.com/yorkie-team/yorkie/pkg/document/operation"
)
type TextProxy struct {
	*json.Text
	context *change.Context
}
func NewTextProxy(ctx *change.Context, text *json.Text) *TextProxy {
	return &TextProxy{
		Text:    text,
		context: ctx,
	}
}