Skip to content

EditorNode

Namespace: Hex1b

Assembly: Hex1b.dll

Node for multi-line document editing. Manages scroll, viewport, and input. Scroll offset is per-node to support different views on the same document. Scrollbars are rendered and handled internally (not composed) because their behavior is tightly coupled to the active IEditorViewRenderer.

csharp
public sealed class EditorNode : Hex1bNode, IEditorSession

Inheritance

ObjectHex1bNodeEditorNode

Implements

Properties

DecorationProviders

Text decoration providers for syntax highlighting, diagnostics, etc.

Returns: IReadOnlyList<ITextDecorationProvider>

csharp
public IReadOnlyList<ITextDecorationProvider>? DecorationProviders { get; }

HorizontalScrollOffset

First visible column (0-based).

Returns: Int32

csharp
public int HorizontalScrollOffset { get; }

IsFocusable

Returns true if this node can receive focus.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

IsFocused

Gets or sets whether this node is currently focused. Only meaningful for focusable nodes (where IsFocusable is true).

Returns: Boolean

csharp
public override bool IsFocused { get; set; }

PreferredCursorShape

Gets the preferred cursor shape when the mouse is over this node. Override this to customize cursor appearance (e.g., text input uses a bar cursor).

Returns: CursorShape

csharp
public override CursorShape PreferredCursorShape { get; }

ScrollOffset

First visible line (1-based).

Returns: Int32

csharp
public int ScrollOffset { get; }

ShowLineNumbers

Whether to show line numbers in a gutter on the left side.

Returns: Boolean

csharp
public bool ShowLineNumbers { get; set; }

SourceWidget

The source widget that was reconciled into this node.

Returns: EditorWidget

csharp
public EditorWidget? SourceWidget { get; set; }

State

The editor state (shared between nodes that share state).

Returns: EditorState

csharp
public EditorState State { get; set; }

ViewportColumns

Number of visible columns in the viewport.

Returns: Int32

csharp
public int ViewportColumns { get; }

ViewportLines

Number of visible lines in the viewport.

Returns: Int32

csharp
public int ViewportLines { get; }

ViewRenderer

The view renderer that controls how document content is displayed.

Returns: IEditorViewRenderer

csharp
public IEditorViewRenderer ViewRenderer { get; set; }

WordWrap

Whether soft line wrapping is enabled.

Returns: Boolean

csharp
public bool WordWrap { get; set; }

Methods

ArrangeCore(Rect)

Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.

Parameters:

csharp
protected override void ArrangeCore(Rect bounds)

ConfigureDefaultBindings(InputBindingsBuilder)

Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.

Parameters:

csharp
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)

MeasureCore(Constraints)

Override this method to implement measuring logic for this node.

Parameters:

Returns: Size

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext)

Renders the node to the given context.

Parameters:

csharp
public override void Render(Hex1bRenderContext context)

Released under the MIT License.