mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
CodeMirrorWikiEditor: add extension for multiple selections/cursors
This was preexisting behaviour in CM5 as a rather hidden feature, and this patch brings it to CM6 keeping it just as hidden. That is, to have focus in the texatrea, hit Ctrl (or ⌘ on Mac) to insert multiple cursors, and similarly multiple selections and change their content. This doesn't actually fix the bug reported at T211205. That may not even be fixable, since jQuery.textSelection is the interface used to interact with editors, and it doesn't support multiple selections. Bug: T211205 Change-Id: I9d4d634c2ba46b909543a0090b871cee4b183fa0
This commit is contained in:
parent
ec28e18016
commit
46b458cc0c
|
@ -52,7 +52,7 @@
|
|||
"bundlesize": [
|
||||
{
|
||||
"path": "resources/dist/main.js",
|
||||
"maxSize": "100.0kB"
|
||||
"maxSize": "105.0kB"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
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,6 +1,6 @@
|
|||
import CodeMirror from './codemirror';
|
||||
import { EditorSelection } from '@codemirror/state';
|
||||
import { EditorView, keymap } from '@codemirror/view';
|
||||
import { EditorState, EditorSelection } from '@codemirror/state';
|
||||
import { EditorView, drawSelection, keymap } from '@codemirror/view';
|
||||
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
||||
import { searchKeymap } from '@codemirror/search';
|
||||
import { bracketMatching } from '@codemirror/language';
|
||||
|
@ -61,6 +61,8 @@ export default class CodeMirrorWikiEditor extends CodeMirror {
|
|||
}
|
||||
} ),
|
||||
EditorView.lineWrapping,
|
||||
EditorState.allowMultipleSelections.of( true ),
|
||||
drawSelection(),
|
||||
keymap.of( [
|
||||
...defaultKeymap,
|
||||
...searchKeymap,
|
||||
|
|
Loading…
Reference in a new issue