mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-12-12 14:25:06 +00:00
f8a89ccf32
The hook handlers and event listeners associated with `CodeMirror.prototype.initialize()` are now removed when CM is toggled off. For 2017 Wikitext Editor, the focus is always set on the VE surface view. Bug: T380840 Bug: T380983 Bug: T381358 Change-Id: Ib83f3d49c3d0496cb570f62e75f3fdc0d700be47
22 lines
497 B
JavaScript
22 lines
497 B
JavaScript
const {
|
|
Extension,
|
|
autocompletion,
|
|
acceptCompletion,
|
|
keymap
|
|
} = require( 'ext.CodeMirror.v6.lib' );
|
|
|
|
/**
|
|
* CodeMirror extension providing
|
|
* autocompletion
|
|
* for the MediaWiki mode. This automatically applied when using {@link CodeMirrorModeMediaWiki}.
|
|
*
|
|
* @module CodeMirrorAutocomplete
|
|
* @type {Extension}
|
|
*/
|
|
const autocompleteExtension = [
|
|
autocompletion( { defaultKeymap: true } ),
|
|
keymap.of( [ { key: 'Tab', run: acceptCompletion } ] )
|
|
];
|
|
|
|
module.exports = autocompleteExtension;
|