Expand all

CodeMirrorGotoLine

Custom goto line panel for CodeMirror using CSS-only Codex components.

Using the Alt-g keybinding, this shows a panel asking the user for a line number, when a valid position is provided, moves the cursor to that line.

This feature supports line numbers, relative line offsets prefixed with + or -, document percentages suffixed with %, and an optional column position by adding : and a second number after the line number.

Based on the CodeMirror implementation (MIT).

Properties

extension :Extension #

Get the panel and any associated keymaps as a CodeMirror Extension.

Type:

Overrides:
Source:
Get the panel and any associated keymaps as a CodeMirror Extension.

panel :Panel #

Get the Panel object.

Type:

Overrides:
Source:
Get the Panel object.

panelStateField :StateField #

Methods

getButton(label, [icon], [iconOnly]) → {HTMLButtonElement} #

Get a CSS-only Codex Button.

Parameters:

Name Type Attributes Default Description
label string
icon string | null optional
null
iconOnly boolean optional
false
Overrides:
Source:

Returns:

Type
HTMLButtonElement
Get a CSS-only Codex Button.

getCheckbox(name, label, [checked]) → {Array.<HTMLElement>} #

Get a CSS-only Codex Checkbox.

Parameters:

Name Type Attributes Default Description
name string
label string
checked boolean optional
false
Overrides:
Source:

Returns:

[HTMLSpanElement, HTMLInputElement]

Type
Array.<HTMLElement>
Get a CSS-only Codex Checkbox.

getFieldset(legendText, …fields) → {Element} #

Get a CSS-only Codex Fieldset.

Parameters:

Name Type Attributes Description
legendText string
fields Array.<HTMLElement> repeatable
Overrides:
Source:

Returns:

Type
Element
Get a CSS-only Codex Fieldset.

getTextInput(name, [value], placeholder) → {Array.<HTMLElement>} #

Get a CSS-only Codex TextInput.

Parameters:

Name Type Attributes Default Description
name string
value string optional
''
placeholder string
Overrides:
Source:

Returns:

[HTMLDivElement, HTMLInputElement]

Type
Array.<HTMLElement>
Get a CSS-only Codex TextInput.

getToggleButton(name, label, icon, [checked]) → {HTMLButtonElement} #

Get a CSS-only Codex ToggleButton.

Parameters:

Name Type Attributes Default Description
name string
label string
icon string
checked boolean optional
false
Overrides:
Source:

Returns:

Type
HTMLButtonElement
Get a CSS-only Codex ToggleButton.

go() #

Go to the specified line.

Source:
Go to the specified line.

onKeydown(event) #

Respond to keydown events.

Parameters:

Name Type Description
event KeyboardEvent
Source:
Respond to keydown events.