Skip to content

EditorWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

Widget for multi-line document editing. Supports shared documents and synced cursors.

csharp
public sealed record EditorWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<EditorWidget>

Inheritance

ObjectHex1bWidgetEditorWidget

Implements

Constructors

EditorWidget(EditorState)

Widget for multi-line document editing. Supports shared documents and synced cursors.

Parameters:

csharp
public EditorWidget(EditorState State)

Properties

State

Returns: EditorState

csharp
public EditorState State { get; init; }

Methods

Decorations(ITextDecorationProvider)

Adds a text decoration provider to the editor. Providers supply per-character styling such as syntax highlighting, diagnostic underlines, and other visual decorations. Multiple providers can be added; their decorations are resolved by priority.

Parameters:

Returns: EditorWidget

csharp
public EditorWidget Decorations(ITextDecorationProvider provider)

Features(LspFeatureSet)

Overrides the enabled LSP feature set. When specified, this takes precedence over the extension's . Use to selectively enable or disable features without creating a custom extension.

Parameters:

Returns: EditorWidget

csharp
public EditorWidget Features(LspFeatureSet features)

Gutter(IGutterProvider)

Adds a gutter provider to the editor's left margin. Multiple providers are rendered left-to-right in registration order.

Parameters:

Returns: EditorWidget

csharp
public EditorWidget Gutter(IGutterProvider provider)

LineNumbers(bool)

Enables or disables line numbers in a gutter on the left side of the editor. This is a convenience method that adds a .

Parameters:

Returns: EditorWidget

csharp
public EditorWidget LineNumbers(bool show = true)

OnTextChanged(Action<EditorTextChangedEventArgs>)

Sets a synchronous handler called when the document text changes.

Parameters:

Returns: EditorWidget

csharp
public EditorWidget OnTextChanged(Action<EditorTextChangedEventArgs> handler)

OnTextChanged(Func<EditorTextChangedEventArgs, Task>)

Sets an asynchronous handler called when the document text changes.

Parameters:

Returns: EditorWidget

csharp
public EditorWidget OnTextChanged(Func<EditorTextChangedEventArgs, Task> handler)

WithViewRenderer(IEditorViewRenderer)

Sets the view renderer for this editor. Use for text or for hex dump views.

Parameters:

Returns: EditorWidget

csharp
public EditorWidget WithViewRenderer(IEditorViewRenderer renderer)

WordWrap(bool)

Enables or disables soft line wrapping. When enabled, lines that exceed the viewport width are visually wrapped to the next display line.

Parameters:

Returns: EditorWidget

csharp
public EditorWidget WordWrap(bool enabled = true)

Fields

AddCursorAtNextMatch

Rebindable action: Add cursor at next match.

Returns: ActionId

csharp
public static readonly ActionId AddCursorAtNextMatch

Click

Rebindable action: Click to position cursor.

Returns: ActionId

csharp
public static readonly ActionId Click

CtrlClick

Rebindable action: Ctrl+Click to add/remove cursor.

Returns: ActionId

csharp
public static readonly ActionId CtrlClick

DeleteBackward

Rebindable action: Delete backward.

Returns: ActionId

csharp
public static readonly ActionId DeleteBackward

DeleteForward

Rebindable action: Delete forward.

Returns: ActionId

csharp
public static readonly ActionId DeleteForward

DeleteLine

Rebindable action: Delete line.

Returns: ActionId

csharp
public static readonly ActionId DeleteLine

DeleteWordBackward

Rebindable action: Delete previous word.

Returns: ActionId

csharp
public static readonly ActionId DeleteWordBackward

DeleteWordForward

Rebindable action: Delete next word.

Returns: ActionId

csharp
public static readonly ActionId DeleteWordForward

DoubleClick

Rebindable action: Double-click to select word.

Returns: ActionId

csharp
public static readonly ActionId DoubleClick

InsertNewline

Rebindable action: Insert newline.

Returns: ActionId

csharp
public static readonly ActionId InsertNewline

InsertTab

Rebindable action: Insert tab.

Returns: ActionId

csharp
public static readonly ActionId InsertTab

MoveDown

Rebindable action: Move cursor down.

Returns: ActionId

csharp
public static readonly ActionId MoveDown

MoveLeft

Rebindable action: Move cursor left.

Returns: ActionId

csharp
public static readonly ActionId MoveLeft

MoveRight

Rebindable action: Move cursor right.

Returns: ActionId

csharp
public static readonly ActionId MoveRight

MoveToDocumentEnd

Rebindable action: Move to document end.

Returns: ActionId

csharp
public static readonly ActionId MoveToDocumentEnd

MoveToDocumentStart

Rebindable action: Move to document start.

Returns: ActionId

csharp
public static readonly ActionId MoveToDocumentStart

MoveToLineEnd

Rebindable action: Move to line end.

Returns: ActionId

csharp
public static readonly ActionId MoveToLineEnd

MoveToLineStart

Rebindable action: Move to line start.

Returns: ActionId

csharp
public static readonly ActionId MoveToLineStart

MoveUp

Rebindable action: Move cursor up.

Returns: ActionId

csharp
public static readonly ActionId MoveUp

MoveWordLeft

Rebindable action: Move to previous word.

Returns: ActionId

csharp
public static readonly ActionId MoveWordLeft

MoveWordRight

Rebindable action: Move to next word.

Returns: ActionId

csharp
public static readonly ActionId MoveWordRight

PageDown

Rebindable action: Page down.

Returns: ActionId

csharp
public static readonly ActionId PageDown

PageUp

Rebindable action: Page up.

Returns: ActionId

csharp
public static readonly ActionId PageUp

Redo

Rebindable action: Redo last undone edit.

Returns: ActionId

csharp
public static readonly ActionId Redo

ScrollDown

Rebindable action: Scroll down.

Returns: ActionId

csharp
public static readonly ActionId ScrollDown

ScrollLeft

Rebindable action: Scroll left.

Returns: ActionId

csharp
public static readonly ActionId ScrollLeft

ScrollRight

Rebindable action: Scroll right.

Returns: ActionId

csharp
public static readonly ActionId ScrollRight

ScrollUp

Rebindable action: Scroll up.

Returns: ActionId

csharp
public static readonly ActionId ScrollUp

SelectAll

Rebindable action: Select all text.

Returns: ActionId

csharp
public static readonly ActionId SelectAll

SelectDown

Rebindable action: Extend selection down.

Returns: ActionId

csharp
public static readonly ActionId SelectDown

SelectLeft

Rebindable action: Extend selection left.

Returns: ActionId

csharp
public static readonly ActionId SelectLeft

SelectPageDown

Rebindable action: Select page down.

Returns: ActionId

csharp
public static readonly ActionId SelectPageDown

SelectPageUp

Rebindable action: Select page up.

Returns: ActionId

csharp
public static readonly ActionId SelectPageUp

SelectRight

Rebindable action: Extend selection right.

Returns: ActionId

csharp
public static readonly ActionId SelectRight

SelectToDocumentEnd

Rebindable action: Select to document end.

Returns: ActionId

csharp
public static readonly ActionId SelectToDocumentEnd

SelectToDocumentStart

Rebindable action: Select to document start.

Returns: ActionId

csharp
public static readonly ActionId SelectToDocumentStart

SelectToLineEnd

Rebindable action: Select to line end.

Returns: ActionId

csharp
public static readonly ActionId SelectToLineEnd

SelectToLineStart

Rebindable action: Select to line start.

Returns: ActionId

csharp
public static readonly ActionId SelectToLineStart

SelectUp

Rebindable action: Extend selection up.

Returns: ActionId

csharp
public static readonly ActionId SelectUp

SelectWordLeft

Rebindable action: Select to previous word.

Returns: ActionId

csharp
public static readonly ActionId SelectWordLeft

SelectWordRight

Rebindable action: Select to next word.

Returns: ActionId

csharp
public static readonly ActionId SelectWordRight

ToggleFold

Rebindable action: Toggle fold at cursor line.

Returns: ActionId

csharp
public static readonly ActionId ToggleFold

TripleClick

Rebindable action: Triple-click to select line.

Returns: ActionId

csharp
public static readonly ActionId TripleClick

Undo

Rebindable action: Undo last edit.

Returns: ActionId

csharp
public static readonly ActionId Undo

Released under the MIT License.