Skip to content

EditGroup ​

Namespace: Hex1b.Documents

Assembly: Hex1b.dll

An atomic group of edit operations that are undone/redone together. Captures cursor state before and after for full undo fidelity.

csharp
public sealed class EditGroup

Inheritance ​

Object → EditGroup

Constructors ​

EditGroup(CursorSetSnapshot, long, string?) ​

Parameters:

csharp
public EditGroup(CursorSetSnapshot cursorsBefore, long versionBefore, string? source = null)

Properties ​

CreatedTicks ​

Timestamp when the group was created (for coalescing timeout).

Returns: Int64

csharp
public long CreatedTicks { get; }

CursorsAfter ​

Cursor positions after the group was applied (set on commit).

Returns: CursorSetSnapshot

csharp
public CursorSetSnapshot? CursorsAfter { get; }

CursorsBefore ​

Cursor positions before the group was applied.

Returns: CursorSetSnapshot

csharp
public CursorSetSnapshot CursorsBefore { get; }

InverseOperations ​

The inverse operations (in reverse application order for undo).

Returns: IReadOnlyList<EditOperation>

csharp
public IReadOnlyList<EditOperation> InverseOperations { get; }

IsCoalescable ​

Whether this group can be coalesced with adjacent typing groups.

Returns: Boolean

csharp
public bool IsCoalescable { get; init; }

IsEmpty ​

Whether this group has any operations.

Returns: Boolean

csharp
public bool IsEmpty { get; }

Operations ​

The operations in this group (in application order).

Returns: IReadOnlyList<EditOperation>

csharp
public IReadOnlyList<EditOperation> Operations { get; }

Source ​

Source tag for the edit (e.g., "typing", "paste", "undo").

Returns: String

csharp
public string? Source { get; }

VersionAfter ​

Document version after the last operation in the group.

Returns: Int64

csharp
public long VersionAfter { get; }

VersionBefore ​

Document version before the first operation in the group.

Returns: Int64

csharp
public long VersionBefore { get; }

Released under the MIT License.