View Source Lexical.Document.Edit (lexical_shared v0.5.0)

A change to a document

A Lexical.Document.Edit represents a single change to a document. It contains the new text and a range where the edit applies.

Link to this section Summary

Functions

Creates a new edit that replaces all text in the document

Creates a new edit that replaces text in the given range

Link to this section Types

@type t() :: %Lexical.Document.Edit{
  range: Lexical.Document.Range.t() | nil,
  text: String.t()
}

Link to this section Functions

@spec new(String.t()) :: t()

Creates a new edit that replaces all text in the document

@spec new(String.t(), Lexical.Document.Range.t() | nil) :: t()

Creates a new edit that replaces text in the given range