Table of Contents

Class TextDocumentEdit

Namespace
TextEdit.Core
Assembly
TextEdit.Core.dll

Builds sequential plain-text changes without mutating the live document.

public sealed class TextDocumentEdit
Inheritance
TextDocumentEdit
Inherited Members

Properties

Snapshot

Gets the candidate after all preceding operations.

public TextSnapshot Snapshot { get; }

Property Value

TextSnapshot

Methods

Delete(TextSpan)

Deletes a bounded UTF-16 range.

public void Delete(TextSpan range)

Parameters

range TextSpan

Insert(int, string)

Inserts text at an exact UTF-16 offset.

public void Insert(int position, string text)

Parameters

position int
text string

NormalizeLineEndings(string)

Explicitly replaces every logical line terminator with LF, CRLF, or CR in this transaction.

public void NormalizeLineEndings(string lineEnding)

Parameters

lineEnding string

Remarks

Text outside terminators is unchanged. The operation participates in ordinary document undo.

Replace(TextSpan, string)

Replaces a bounded UTF-16 range without normalizing line endings.

public void Replace(TextSpan range, string text)

Parameters

range TextSpan
text string

ReplaceBatch(IEnumerable<TextReplacement>)

Applies disjoint replacements in the current candidate's original coordinates. Same-position insertions retain caller order.

public void ReplaceBatch(IEnumerable<TextReplacement> replacements)

Parameters

replacements IEnumerable<TextReplacement>

SetSelections(TextSelectionSet)

Sets the invoking session's selection in final candidate coordinates.

public void SetSelections(TextSelectionSet selections)

Parameters

selections TextSelectionSet