Skip to content

Documentation / joplin-plugin-api / CodeMirrorControl

Interface: CodeMirrorControl

Properties

cm6

cm6: any

Defined in

types.ts:543


editor

editor: any

Points to a CodeMirror 6 EditorView instance.

Defined in

types.ts:542


joplinExtensions

joplinExtensions: object

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

Defined in

types.ts:552

Methods

addExtension()

addExtension(extension): void

extension should be a CodeMirror 6 extension.

Parameters

extension: any

Returns

void

Defined in

types.ts:546


execCommand()

execCommand(name, ...args): any

Parameters

name: string

• ...args: any[]

Returns

any

Defined in

types.ts:549


registerCommand()

registerCommand(name, callback): void

Parameters

name: string

callback: EditorCommandCallback

Returns

void

Defined in

types.ts:550


supportsCommand()

supportsCommand(name): boolean

Parameters

name: string

Returns

boolean

Defined in

types.ts:548

Released under the MIT License.