Skip to content

Documentation / jpl-vite / api / CodeMirrorControl

Interface: CodeMirrorControl

Defined in: joplin-plugin-api/dist/types.d.ts:411

Properties

cm6

cm6: any

Defined in: joplin-plugin-api/dist/types.d.ts:414


editor

editor: any

Defined in: joplin-plugin-api/dist/types.d.ts:413

Points to a CodeMirror 6 EditorView instance.


joplinExtensions

joplinExtensions: object

Defined in: joplin-plugin-api/dist/types.d.ts:420

enableLanguageDataAutocomplete

enableLanguageDataAutocomplete: object

Creates an extension that enables or disables languageData-based autocompletion.

enableLanguageDataAutocomplete.of()

enableLanguageDataAutocomplete.of: (enabled) => any

Parameters
enabled

boolean

Returns

any

completionSource()

Returns a CodeMirror 6 extension that registers the given CompletionSource.

Use this extension rather than the built-in CodeMirror autocompletion if you don't want to use languageData-based autocompletion.

Using autocompletion({ override: [ ... ]}) causes errors when done by multiple plugins.

Parameters
completionSource

any

Returns

any

Methods

addExtension()

addExtension(extension): void

Defined in: joplin-plugin-api/dist/types.d.ts:416

extension should be a CodeMirror 6 extension.

Parameters

extension

any

Returns

void


execCommand()

execCommand(name, ...args): any

Defined in: joplin-plugin-api/dist/types.d.ts:418

Parameters

name

string

args

...any[]

Returns

any


registerCommand()

registerCommand(name, callback): void

Defined in: joplin-plugin-api/dist/types.d.ts:419

Parameters

name

string

callback

EditorCommandCallback

Returns

void


supportsCommand()

supportsCommand(name): boolean

Defined in: joplin-plugin-api/dist/types.d.ts:417

Parameters

name

string

Returns

boolean

Released under the MIT License.