mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 13:56:44 +00:00
Merge "CodeMirrorWikiEditor: add bracketMatching as default extension"
This commit is contained in:
commit
ed36d5284f
|
@ -35,3 +35,10 @@ _NOTE: Consider using [Fresh](https://gerrit.wikimedia.org/g/fresh/) to run thes
|
|||
|
||||
Older QUnit tests are in `resources/mode/mediawiki/tests/qunit/`. These will
|
||||
eventually be moved over to `tests/qunit` and rewritten for CodeMirror 6.
|
||||
|
||||
## CodeMirror 6 change log
|
||||
|
||||
This list changes that come by default with the CodeMirror 6 upgrade.
|
||||
Some may be removed pending user feedback:
|
||||
|
||||
* Bracket matching now highlights unmatched brackets in red
|
||||
|
|
13
package-lock.json
generated
13
package-lock.json
generated
|
@ -10,6 +10,7 @@
|
|||
"@babel/plugin-transform-runtime": "7.22.15",
|
||||
"@babel/preset-env": "7.3.0",
|
||||
"@codemirror/commands": "6.2.5",
|
||||
"@codemirror/language": "6.9.3",
|
||||
"@codemirror/search": "6.5.4",
|
||||
"@codemirror/state": "6.2.1",
|
||||
"@codemirror/view": "6.18.1",
|
||||
|
@ -1331,9 +1332,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@codemirror/language": {
|
||||
"version": "6.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz",
|
||||
"integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==",
|
||||
"version": "6.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.3.tgz",
|
||||
"integrity": "sha512-qq48pYzoi6ldYWV/52+Z9Ou6QouVI+8YwvxFbUypI33NbjG2UeRHKENRyhwljTTiOqjQ33FjyZj6EREQ9apAOQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
|
@ -21915,9 +21916,9 @@
|
|||
}
|
||||
},
|
||||
"@codemirror/language": {
|
||||
"version": "6.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz",
|
||||
"integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==",
|
||||
"version": "6.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.3.tgz",
|
||||
"integrity": "sha512-qq48pYzoi6ldYWV/52+Z9Ou6QouVI+8YwvxFbUypI33NbjG2UeRHKENRyhwljTTiOqjQ33FjyZj6EREQ9apAOQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
"@babel/plugin-transform-runtime": "7.22.15",
|
||||
"@babel/preset-env": "7.3.0",
|
||||
"@codemirror/commands": "6.2.5",
|
||||
"@codemirror/language": "6.9.3",
|
||||
"@codemirror/search": "6.5.4",
|
||||
"@codemirror/state": "6.2.1",
|
||||
"@codemirror/view": "6.18.1",
|
||||
|
|
2
resources/dist/main.js
vendored
2
resources/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
resources/dist/main.js.map.json
vendored
2
resources/dist/main.js.map.json
vendored
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,10 @@
|
|||
.cm-editor {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.cm-matchingBracket,
|
||||
.cm-focused .cm-matchingBracket {
|
||||
background-color: #eee;
|
||||
box-shadow: inset 0 0 1px 1px #999;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import { EditorSelection } from '@codemirror/state';
|
|||
import { EditorView, keymap } from '@codemirror/view';
|
||||
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
||||
import { searchKeymap } from '@codemirror/search';
|
||||
import { bracketMatching } from '@codemirror/language';
|
||||
|
||||
/**
|
||||
* @class CodeMirrorWikiEditor
|
||||
|
@ -43,6 +44,7 @@ export default class CodeMirrorWikiEditor extends CodeMirror {
|
|||
*/
|
||||
const extensions = [
|
||||
...this.defaultExtensions,
|
||||
bracketMatching(),
|
||||
history(),
|
||||
// See also the default attributes at contentAttributesExtension() in the parent class.
|
||||
EditorView.contentAttributes.of( {
|
||||
|
|
Loading…
Reference in a new issue