public readonly record struct TextPositionA place in a text buffer, by line and by character within it.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
⚠ Two numbers rather than one offset. An offset is smaller and is what a compiler wants; an editor asks "which line is this on" for every row it draws, every diagnostic it places and every caret movement, and answering that from an offset needs a line-start index maintained on every edit. Vixen.Core.Syntax's SourceText keeps one because it is handed whole files; this is edited a keystroke at a time.
Fields and properties (2)
public int LineWhich line, from zero.
public int ColumnHow many characters into it, from zero.
Methods (7)
public TextPosition(int Line, int Column)A place in a text buffer, by line and by character within it.
public int CompareTo(TextPosition other)Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public static bool operator <(TextPosition left, TextPosition right)Whether one place is before another.
public static bool operator >(TextPosition left, TextPosition right)Whether one place is after another.
public static bool operator <=(TextPosition left, TextPosition right)Whether one place is before another or the same.
public static bool operator >=(TextPosition left, TextPosition right)Whether one place is after another or the same.
public override string ToString()Returns the fully qualified type name of this instance.
Used by (5)
- CodeBufferVixen.Ui.Controls.Advanced
- CodeBufferTestsVixen.Ui.Controls.Advanced.Tests
- CodeEditorVixen.Ui.Controls.Advanced
- CodeEditorTestsVixen.Ui.Controls.Advanced.Tests
- CodeDocumentTestsVixen.Editor.AssetEditors.Tests