Table of Contents

Namespace Terminal.Gui.Editor.Document

UI-framework-independent document model — rope-backed TextDocument, DocumentLine, TextAnchor, UndoStack, ITextSource, TextSegment, and supporting types.

The document layer has no dependency on Terminal.Gui and can be used independently for text manipulation, analysis, or testing. It is adapted from AvaloniaEdit's pure-data layers.

Key Types

  • TextDocument - The rope-backed document (efficient insert/delete at any position)
  • DocumentLine - Represents a single line in the document
  • TextAnchor - A position that tracks across edits
  • UndoStack - Undo/redo with compound grouping
  • ITextSource - Read-only text source abstraction
  • TextSegment - Offset+length region in the document

Classes

AnchorSegment
DocumentChangeEventArgs
DocumentChangedEventArgs
DocumentLine
DocumentTextWriter
OffsetChangeMap
RopeTextSource
SegmentExtensions
StringTextSource
TextAnchor
TextChangeEventArgs
TextDocument
TextDocumentWeakEventManager
TextDocumentWeakEventManager.Changed
TextDocumentWeakEventManager.Changing
TextDocumentWeakEventManager.LineCountChanged
TextDocumentWeakEventManager.TextChanged
TextDocumentWeakEventManager.TextLengthChanged
TextDocumentWeakEventManager.UpdateFinished
TextDocumentWeakEventManager.UpdateStarted
TextLocationConverter
TextSegment
TextSegmentCollection<T>
TextSourceVersionProvider
TextUtilities
UndoStack
WeakLineTracker

Structs

OffsetChangeMapEntry
SimpleSegment
TextDocumentProgress
TextLocation

Interfaces

IDocument
IDocumentLine
ILineTracker
ISegment
ITextAnchor
ITextSource
ITextSourceVersion
IUndoableOperation

Enums

AnchorMovementType
CaretPositioningMode
CharacterClass
LogicalDirection
OffsetChangeMappingType