CodeMirror editor.

Implements

Constructors

Properties

edgeRequested: Signal<CodeMirrorEditor, EdgeLocation> = ...

A signal emitted when either the top or bottom edge is requested.

The DOM node that hosts the editor.

Accessors

Methods

  • Parameters

    • where: boolean
    • Optionalmode: "window" | "page" | "local"

    Returns { bottom: number; left: number; top: number }

  • Execute a codemirror command on the editor.

    Parameters

    • command: Command | StateCommand

      The name of the command to execute.

    Returns void

  • Parameters

    • from: { ch: number; line: number }
    • to: { ch: number; line: number }
    • Optionalseparator: string

    Returns string

  • Handle the DOM events for the editor.

    Parameters

    • event: Event

      The DOM event sent to the editor.

      This method implements the DOM EventListener interface and is called in response to events on the editor's DOM node. It should not be called directly by user code.

    Returns void

  • Set the primary position of the cursor.

    This will remove any secondary cursors.

    Parameters

    • position: IPosition
    • options: { bias?: number; origin?: string; scroll?: boolean } = {}

    Returns void

    options bias and origin are not used

  • Set config options for the editor.

    This method is preferred when setting several options. The options are set within an operation, which only performs the costly update at the end, and not after every option is set.

    Parameters

    Returns void

  • Sets the selections for all the cursors, should not be empty. Cursors will be removed or added, as necessary. Passing an empty array resets a cursor position to the start of a document.

    Parameters

    Returns void