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
Methods
Delete(TextSpan)
Deletes a bounded UTF-16 range.
public void Delete(TextSpan range)
Parameters
rangeTextSpan
Insert(int, string)
Inserts text at an exact UTF-16 offset.
public void Insert(int position, string text)
Parameters
NormalizeLineEndings(string)
Explicitly replaces every logical line terminator with LF, CRLF, or CR in this transaction.
public void NormalizeLineEndings(string lineEnding)
Parameters
lineEndingstring
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
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
replacementsIEnumerable<TextReplacement>
SetSelections(TextSelectionSet)
Sets the invoking session's selection in final candidate coordinates.
public void SetSelections(TextSelectionSet selections)
Parameters
selectionsTextSelectionSet