@uiw/react-codemirror 4.25.1 → 4.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,37 +1,40 @@
1
1
  <div markdown="1">
2
2
  <sup>Using <a href="https://wangchujiang.com/#/app" target="_blank">my app</a> is also a way to <a href="https://wangchujiang.com/#/sponsor" target="_blank">support</a> me:</sup>
3
3
  <br>
4
- <a target="_blank" href="https://apps.apple.com/app/Vidwall/6747587746" title="Vidwall for macOS"><img align="center" alt="Vidwall" height="52" width="52" src="https://github.com/user-attachments/assets/7b5df70a-ed91-4d4b-85be-f00e60a09ce9"></a>
5
- <a target="_blank" href="https://wangchujiang.com/mousio-hint/" title="Mousio Hint for macOS"><img align="center" alt="Mousio Hint" height="52" width="52" src="https://github.com/user-attachments/assets/3c0af128-0cef-44e5-a8db-4741dc5a6690"></a>
6
- <a target="_blank" href="https://apps.apple.com/app/6746747327" title="Mousio for macOS"><img align="center" alt="Mousio" height="52" width="52" src="https://github.com/user-attachments/assets/9edf61ff-5a6c-4676-9cc2-8fd3c1ad0dfb"></a>
7
- <a target="_blank" href="https://apps.apple.com/app/6745227444" title="Musicer for macOS"><img align="center" alt="Musicer" height="52" width="52" src="https://github.com/user-attachments/assets/b7abfba8-88ff-4c86-a125-43073d5aef22"></a>
8
- <a target="_blank" href="https://apps.apple.com/app/6743841447" title="Audioer for macOS"><img align="center" alt="Audioer" height="52" width="52" src="https://github.com/user-attachments/assets/7a836865-8c90-4119-87bc-19e06a76c957"></a>
9
- <a target="_blank" href="https://apps.apple.com/app/6744690194" title="FileSentinel for macOS"><img align="center" alt="FileSentinel" height="52" width="52" src="https://github.com/user-attachments/assets/28bce2cc-290e-45bf-9068-585ff6ecafe9"></a>
10
- <a target="_blank" href="https://apps.apple.com/app/6743495172" title="FocusCursor for macOS"><img align="center" alt="FocusCursor" height="52" width="52" src="https://github.com/user-attachments/assets/d543668a-737b-4853-a6bb-eaa269e69836"></a>
11
- <a target="_blank" href="https://apps.apple.com/app/6742680573" title="Videoer for macOS"><img align="center" alt="Videoer" height="52" width="52" src="https://github.com/user-attachments/assets/10ffb0f1-0625-40d6-93f1-2c2496592595"></a>
12
- <a target="_blank" href="https://apps.apple.com/app/6740425504" title="KeyClicker for macOS"><img align="center" alt="KeyClicker" height="52" width="52" src="https://github.com/user-attachments/assets/5a19fcb9-cb81-4855-b4ea-31c604d9612a"></a>
13
- <a target="_blank" href="https://apps.apple.com/app/6739052447" title="DayBar for macOS"><img align="center" alt="DayBar" height="52" width="52" src="https://github.com/user-attachments/assets/771b608d-594c-492d-8532-d9231e383f5b"></a>
14
- <a target="_blank" href="https://apps.apple.com/app/6739444407" title="Iconed for macOS"><img align="center" alt="Iconed" height="52" width="52" src="https://github.com/user-attachments/assets/8a35dc7b-4faf-4e2a-9311-f66d6844a896"></a>
15
- <a target="_blank" href="https://apps.apple.com/app/6737160756" title="RightMenu Master for macOS"><img align="center" alt="RightMenu Master" height="52" width="52" src="https://github.com/user-attachments/assets/39a76541-71bf-4de7-a01c-c62f0557dff5"></a>
16
- <a target="_blank" href="https://apps.apple.com/app/6723903021" title="Paste Quick for macOS"><img align="center" alt="Quick RSS" height="52" width="52" src="https://github.com/user-attachments/assets/bdaad5b7-9810-44ce-8f17-8410864465d2"></a>
17
- <a target="_blank" href="https://apps.apple.com/app/6670696072" title="Quick RSS for macOS/iOS"><img align="center" alt="Quick RSS" height="52" width="52" src="https://github.com/user-attachments/assets/374106b5-a448-4d1d-9ccb-b04b6bc681ed"></a>
18
- <a target="_blank" href="https://apps.apple.com/app/6670167443" title="Web Serve for macOS"><img align="center" alt="Web Serve" height="52" width="52" src="https://github.com/user-attachments/assets/e1d9f76f-0f3d-4ba5-8a15-253ee173bb1c"></a>
19
- <a target="_blank" href="https://apps.apple.com/app/6503953628" title="Copybook Generator for macOS/iOS"><img align="center" alt="Copybook Generator" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/b90e42ff-158b-4534-82ca-5898fd0e8d73"></a>
20
- <a target="_blank" href="https://apps.apple.com/app/6471227008" title="DevTutor for macOS/iOS"><img align="center" alt="DevTutor for SwiftUI" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/f15c154d-0192-48eb-8e0e-9e245ffd974a"></a>
21
- <a target="_blank" href="https://apps.apple.com/app/6479819388" title="RegexMate for macOS/iOS"><img align="center" alt="RegexMate" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/aabe5aa9-9a96-4390-8bed-c3e4023d0dea"></a>
22
- <a target="_blank" href="https://apps.apple.com/app/6479194014" title="Time Passage for macOS/iOS"><img align="center" alt="Time Passage" height="52" width="52" src="https://github.com/jaywcjlove/time-passage/assets/1680273/6f30e429-e6f3-4dbe-9921-a5effe2a05e9"></a>
23
- <a target="_blank" href="https://apps.apple.com/app/6478772538" title="IconizeFolder for macOS"><img align="center" alt="Iconize Folder" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/fa9d8b9c-1e51-4ded-877c-fa5b21c47220"></a>
24
- <a target="_blank" href="https://apps.apple.com/app/6478511402" title="Textsound Saver for macOS/iOS"><img align="center" alt="Textsound Saver" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/0595e842-980b-4574-8891-a8ba853a08be"></a>
25
- <a target="_blank" href="https://apps.apple.com/app/6476924627" title="Create Custom Symbols for macOS"><img align="center" alt="Create Custom Symbols" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/8cd022ce-a3f1-4e89-b7c6-6fbd0d4db77c"></a>
26
- <a target="_blank" href="https://apps.apple.com/app/6476452351" title="DevHub for macOS"><img align="center" alt="DevHub" height="52" width="52" src="https://github.com/user-attachments/assets/4a44a4fd-67ce-430b-af0a-72f18feaa47d"></a>
27
- <a target="_blank" href="https://apps.apple.com/app/6476400184" title="Resume Revise for macOS"><img align="center" alt="Resume Revise" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/c9954a20-1905-48de-bdf8-d71837974aa2"></a>
28
- <a target="_blank" href="https://apps.apple.com/app/6472593276" title="Palette Genius for macOS"><img align="center" alt="Palette Genius" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/27340413-d355-45b2-8f6f-6ac37682d957"></a>
29
- <a target="_blank" href="https://apps.apple.com/app/6470879005" title="Symbol Scribe for macOS"><img align="center" alt="Symbol Scribe" height="52" width="52" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/c7249f05-fa70-4def-a1e9-571d5f171fc9"></a>
4
+ <a target="_blank" href="https://apps.apple.com/app/Keyzer/6500434773" title="Keyzer for macOS"><img alt="Keyzer" height="52" width="52" src="https://wangchujiang.com/appicon/keyzer.png"></a>
5
+ <a target="_blank" href="https://github.com/jaywcjlove/vidwall-hub" title="Vidwall Hub for macOS"><img alt="Vidwall Hub" height="52" width="52" src="https://wangchujiang.com/appicon/vidwall-hub.png"></a>
6
+ <a target="_blank" href="https://apps.apple.com/app/VidCrop/6752624705" title="VidCrop for macOS"><img alt="VidCrop" height="52" width="52" src="https://wangchujiang.com/appicon/vidcrop.png"></a>
7
+ <a target="_blank" href="https://apps.apple.com/app/Vidwall/6747587746" title="Vidwall for macOS"><img alt="Vidwall" height="52" width="52" src="https://wangchujiang.com/appicon/vidwall.png"></a>
8
+ <a target="_blank" href="https://wangchujiang.com/mousio-hint/" title="Mousio Hint for macOS"><img alt="Mousio Hint" height="52" width="52" src="https://wangchujiang.com/appicon/mousio-hint.png"></a>
9
+ <a target="_blank" href="https://apps.apple.com/app/6746747327" title="Mousio for macOS"><img alt="Mousio" height="52" width="52" src="https://wangchujiang.com/appicon/mousio.png"></a>
10
+ <a target="_blank" href="https://apps.apple.com/app/6745227444" title="Musicer for macOS"><img alt="Musicer" height="52" width="52" src="https://wangchujiang.com/appicon/musicer.png"></a>
11
+ <a target="_blank" href="https://apps.apple.com/app/6743841447" title="Audioer for macOS"><img alt="Audioer" height="52" width="52" src="https://wangchujiang.com/appicon/audioer.png"></a>
12
+ <a target="_blank" href="https://apps.apple.com/app/6744690194" title="FileSentinel for macOS"><img alt="FileSentinel" height="52" width="52" src="https://wangchujiang.com/appicon/file-sentinel.png"></a>
13
+ <a target="_blank" href="https://apps.apple.com/app/6743495172" title="FocusCursor for macOS"><img alt="FocusCursor" height="52" width="52" src="https://wangchujiang.com/appicon/focus-cursor.png"></a>
14
+ <a target="_blank" href="https://apps.apple.com/app/6742680573" title="Videoer for macOS"><img alt="Videoer" height="52" width="52" src="https://wangchujiang.com/appicon/videoer.png"></a>
15
+ <a target="_blank" href="https://apps.apple.com/app/6740425504" title="KeyClicker for macOS"><img alt="KeyClicker" height="52" width="52" src="https://wangchujiang.com/appicon/key-clicker.png"></a>
16
+ <a target="_blank" href="https://apps.apple.com/app/6739052447" title="DayBar for macOS"><img alt="DayBar" height="52" width="52" src="https://wangchujiang.com/appicon/daybar.png"></a>
17
+ <a target="_blank" href="https://apps.apple.com/app/6739444407" title="Iconed for macOS"><img alt="Iconed" height="52" width="52" src="https://wangchujiang.com/appicon/iconed.png"></a>
18
+ <a target="_blank" href="https://apps.apple.com/app/6737160756" title="Mousio for macOS"><img alt="Mousio" height="52" width="52" src="https://wangchujiang.com/appicon/rightmenu-master.png"></a>
19
+ <a target="_blank" href="https://apps.apple.com/app/6723903021" title="Paste Quick for macOS"><img alt="Quick RSS" height="52" width="52" src="https://wangchujiang.com/appicon/paste-quick.png"></a>
20
+ <a target="_blank" href="https://apps.apple.com/app/6670696072" title="Quick RSS for macOS/iOS"><img alt="Quick RSS" height="52" width="52" src="https://wangchujiang.com/appicon/quick-rss.png"></a>
21
+ <a target="_blank" href="https://apps.apple.com/app/6670167443" title="Web Serve for macOS"><img alt="Web Serve" height="52" width="52" src="https://wangchujiang.com/appicon/web-serve.png"></a>
22
+ <a target="_blank" href="https://apps.apple.com/app/6503953628" title="Copybook Generator for macOS/iOS"><img alt="Copybook Generator" height="52" width="52" src="https://wangchujiang.com/appicon/copybook-generator.png"></a>
23
+ <a target="_blank" href="https://apps.apple.com/app/6471227008" title="DevTutor for macOS/iOS"><img alt="DevTutor for SwiftUI" height="52" width="52" src="https://wangchujiang.com/appicon/devtutor.png"></a>
24
+ <a target="_blank" href="https://apps.apple.com/app/6479819388" title="RegexMate for macOS/iOS"><img alt="RegexMate" height="52" width="52" src="https://wangchujiang.com/appicon/regex-mate.png"></a>
25
+ <a target="_blank" href="https://apps.apple.com/app/6479194014" title="Time Passage for macOS/iOS"><img alt="Time Passage" height="52" width="52" src="https://wangchujiang.com/appicon/time-passage.png"></a>
26
+ <a target="_blank" href="https://apps.apple.com/app/6478772538" title="IconizeFolder for macOS"><img alt="Iconize Folder" height="52" width="52" src="https://wangchujiang.com/appicon/iconize-folder.png"></a>
27
+ <a target="_blank" href="https://apps.apple.com/app/6478511402" title="Textsound Saver for macOS/iOS"><img alt="Textsound Saver" height="52" width="52" src="https://wangchujiang.com/appicon/textsound-saver.png"></a>
28
+ <a target="_blank" href="https://apps.apple.com/app/6476924627" title="Create Custom Symbols for macOS"><img alt="Create Custom Symbols" height="52" width="52" src="https://wangchujiang.com/appicon/create-custom-symbols.png"></a>
29
+ <a target="_blank" href="https://apps.apple.com/app/6476452351" title="DevHub for macOS"><img alt="DevHub" height="52" width="52" src="https://wangchujiang.com/appicon/devhub.png"></a>
30
+ <a target="_blank" href="https://apps.apple.com/app/6476400184" title="Resume Revise for macOS"><img alt="Resume Revise" height="52" width="52" src="https://wangchujiang.com/appicon/resume-revise.png"></a>
31
+ <a target="_blank" href="https://apps.apple.com/app/6472593276" title="Palette Genius for macOS"><img alt="Palette Genius" height="52" width="52" src="https://wangchujiang.com/appicon/palette-genius.png"></a>
32
+ <a target="_blank" href="https://apps.apple.com/app/6470879005" title="Symbol Scribe for macOS"><img alt="Symbol Scribe" height="52" width="52" src="https://wangchujiang.com/appicon/symbol-scribe.png"></a>
30
33
  <br><br>
31
34
  </div>
32
35
  <hr>
33
36
 
34
- <p align="center">
37
+ <p>
35
38
  <a href="https://uiwjs.github.io/react-codemirror/">
36
39
  <img alt="react-codemirror logo" src="https://user-images.githubusercontent.com/1680273/177491470-c31a6d7e-f676-4914-a027-2fbeebfeb5b4.svg">
37
40
  </a>
@@ -172,6 +175,7 @@ export default function App() {
172
175
  - ~~`@codemirror/legacy-modes/mode/cpp`~~ => [`@codemirror/lang-cpp`](https://www.npmjs.com/package/@codemirror/lang-cpp)
173
176
  - ~~`@codemirror/legacy-modes/mode/html`~~ => [`@codemirror/lang-html`](https://www.npmjs.com/package/@codemirror/lang-html)
174
177
  - ~~`@codemirror/legacy-modes/mode/java`~~ => [`@codemirror/lang-java`](https://www.npmjs.com/package/@codemirror/lang-java)
178
+ - ~~`@codemirror/legacy-modes/mode/go`~~ => [`@codemirror/lang-go`](https://www.npmjs.com/package/@codemirror/lang-go)
175
179
  - ~~`@codemirror/legacy-modes/mode/javascript`~~ => [`@codemirror/lang-javascript`](https://www.npmjs.com/package/@codemirror/lang-javascript)
176
180
  - ~~`@codemirror/legacy-modes/mode/json`~~ => [`@codemirror/lang-json`](https://www.npmjs.com/package/@codemirror/lang-json)
177
181
  - ~~`@codemirror/legacy-modes/mode/lezer`~~ => [`@codemirror/lang-lezer`](https://www.npmjs.com/package/@codemirror/lang-lezer)
@@ -237,7 +237,7 @@ must be quoted as JSON strings.
237
237
  For example:
238
238
 
239
239
  ```javascript
240
- parser.withProps(
240
+ parser.configure({props: [
241
241
  styleTags({
242
242
  // Style Number and BigNumber nodes
243
243
  "Number BigNumber": tags.number,
@@ -252,7 +252,7 @@ parser.withProps(
252
252
  // Style the node named "/" as punctuation
253
253
  '"/"': tags.punctuation
254
254
  })
255
- )
255
+ ]})
256
256
  ```
257
257
  */
258
258
  function styleTags(spec) {
@@ -294,7 +294,30 @@ function styleTags(spec) {
294
294
  }
295
295
  return ruleNodeProp.add(byName);
296
296
  }
297
- const ruleNodeProp = new dist/* NodeProp */.uY();
297
+ const ruleNodeProp = new dist/* NodeProp */.uY({
298
+ combine(a, b) {
299
+ let cur, root, take;
300
+ while (a || b) {
301
+ if (!a || b && a.depth >= b.depth) {
302
+ take = b;
303
+ b = b.next;
304
+ }
305
+ else {
306
+ take = a;
307
+ a = a.next;
308
+ }
309
+ if (cur && cur.mode == take.mode && !take.context && !cur.context)
310
+ continue;
311
+ let copy = new Rule(take.tags, take.mode, take.context);
312
+ if (cur)
313
+ cur.next = copy;
314
+ else
315
+ root = copy;
316
+ cur = copy;
317
+ }
318
+ return root;
319
+ }
320
+ });
298
321
  class Rule {
299
322
  constructor(tags, mode, context, next) {
300
323
  this.tags = tags;
@@ -3493,7 +3516,7 @@ class Parse {
3493
3516
  advance() {
3494
3517
  let context = ParseContext.get();
3495
3518
  let parseEnd = this.stoppedAt == null ? this.to : Math.min(this.to, this.stoppedAt);
3496
- let end = Math.min(parseEnd, this.chunkStart + 2048 /* C.ChunkSize */);
3519
+ let end = Math.min(parseEnd, this.chunkStart + 512 /* C.ChunkSize */);
3497
3520
  if (context)
3498
3521
  end = Math.min(end, context.viewport.to);
3499
3522
  while (this.parsedPos < end)
@@ -3599,7 +3622,7 @@ class Parse {
3599
3622
  length: this.parsedPos - this.chunkStart,
3600
3623
  nodeSet,
3601
3624
  topID: 0,
3602
- maxBufferLength: 2048 /* C.ChunkSize */,
3625
+ maxBufferLength: 512 /* C.ChunkSize */,
3603
3626
  reused: this.chunkReused
3604
3627
  });
3605
3628
  tree = new dist/* Tree */.PH(tree.type, tree.children, tree.positions, tree.length, [[this.lang.stateAfter, this.lang.streamParser.copyState(this.state)]]);
@@ -3867,6 +3890,7 @@ class NodeProp {
3867
3890
  this.deserialize = config.deserialize || (() => {
3868
3891
  throw new Error("This node type doesn't define a deserialize function");
3869
3892
  });
3893
+ this.combine = config.combine || null;
3870
3894
  }
3871
3895
  /**
3872
3896
  This is meant to be used with
@@ -4131,7 +4155,10 @@ class NodeSet {
4131
4155
  if (add) {
4132
4156
  if (!newProps)
4133
4157
  newProps = Object.assign({}, type.props);
4134
- newProps[add[0].id] = add[1];
4158
+ let value = add[1], prop = add[0];
4159
+ if (prop.combine && prop.id in newProps)
4160
+ value = prop.combine(newProps[prop.id], value);
4161
+ newProps[prop.id] = value;
4135
4162
  }
4136
4163
  }
4137
4164
  newTypes.push(newProps ? new NodeType(type.name, newProps, type.id, type.flags) : type);
@@ -5114,7 +5141,7 @@ function buildTree(data) {
5114
5141
  function takeNode(parentStart, minPos, children, positions, inRepeat, depth) {
5115
5142
  let { id, start, end, size } = cursor;
5116
5143
  let lookAheadAtStart = lookAhead, contextAtStart = contextHash;
5117
- while (size < 0) {
5144
+ if (size < 0) {
5118
5145
  cursor.next();
5119
5146
  if (size == -1 /* SpecialRecord.Reuse */) {
5120
5147
  let node = reused[id];
@@ -5719,8 +5746,15 @@ class MixedParse {
5719
5746
  }
5720
5747
  else if (!cursor.type.isAnonymous && (nest = this.nest(cursor, this.input)) &&
5721
5748
  (cursor.from < cursor.to || !nest.overlay)) {
5722
- if (!cursor.tree)
5749
+ if (!cursor.tree) {
5723
5750
  materialize(cursor);
5751
+ // materialize create one more level of nesting
5752
+ // we need to add depth to active overlay for going backwards
5753
+ if (overlay)
5754
+ overlay.depth++;
5755
+ if (covered)
5756
+ covered.depth++;
5757
+ }
5724
5758
  let oldMounts = fragmentCursor.findMounts(cursor.from, nest.parser);
5725
5759
  if (typeof nest.overlay == "function") {
5726
5760
  overlay = new ActiveOverlay(nest.parser, nest.overlay, oldMounts, this.inner.length, cursor.from, cursor.tree, overlay);
@@ -7797,16 +7831,20 @@ selection range that has the same text in front of it.
7797
7831
  */
7798
7832
  function insertCompletionText(state, text, from, to) {
7799
7833
  let { main } = state.selection, fromOff = from - main.from, toOff = to - main.from;
7800
- return Object.assign(Object.assign({}, state.changeByRange(range => {
7801
- if (range != main && from != to &&
7802
- state.sliceDoc(range.from + fromOff, range.from + toOff) != state.sliceDoc(from, to))
7803
- return { range };
7804
- let lines = state.toText(text);
7805
- return {
7806
- changes: { from: range.from + fromOff, to: to == main.from ? range.to : range.from + toOff, insert: lines },
7807
- range: state_.EditorSelection.cursor(range.from + fromOff + lines.length)
7808
- };
7809
- })), { scrollIntoView: true, userEvent: "input.complete" });
7834
+ return {
7835
+ ...state.changeByRange(range => {
7836
+ if (range != main && from != to &&
7837
+ state.sliceDoc(range.from + fromOff, range.from + toOff) != state.sliceDoc(from, to))
7838
+ return { range };
7839
+ let lines = state.toText(text);
7840
+ return {
7841
+ changes: { from: range.from + fromOff, to: to == main.from ? range.to : range.from + toOff, insert: lines },
7842
+ range: state_.EditorSelection.cursor(range.from + fromOff + lines.length)
7843
+ };
7844
+ }),
7845
+ scrollIntoView: true,
7846
+ userEvent: "input.complete"
7847
+ };
7810
7848
  }
7811
7849
  const SourceCache = /*@__PURE__*/new WeakMap();
7812
7850
  function asSource(source) {
@@ -8194,7 +8232,8 @@ class CompletionTooltip {
8194
8232
  this.range = rangeAroundSelected(open.options.length, open.selected, this.view.state.facet(completionConfig).maxRenderedOptions);
8195
8233
  this.showOptions(open.options, cState.id);
8196
8234
  }
8197
- if (this.updateSelectedOption(open.selected)) {
8235
+ let newSel = this.updateSelectedOption(open.selected);
8236
+ if (newSel) {
8198
8237
  this.destroyInfo();
8199
8238
  let { completion } = open.options[open.selected];
8200
8239
  let { info } = completion;
@@ -8211,6 +8250,7 @@ class CompletionTooltip {
8211
8250
  }
8212
8251
  else {
8213
8252
  this.addInfoPane(infoResult, completion);
8253
+ newSel.setAttribute("aria-describedby", this.info.id);
8214
8254
  }
8215
8255
  }
8216
8256
  }
@@ -8218,6 +8258,7 @@ class CompletionTooltip {
8218
8258
  this.destroyInfo();
8219
8259
  let wrap = this.info = document.createElement("div");
8220
8260
  wrap.className = "cm-tooltip cm-completionInfo";
8261
+ wrap.id = "cm-completionInfo-" + Math.floor(Math.random() * 0xffff).toString(16);
8221
8262
  if (content.nodeType != null) {
8222
8263
  wrap.appendChild(content);
8223
8264
  this.infoDestroy = null;
@@ -8243,8 +8284,10 @@ class CompletionTooltip {
8243
8284
  }
8244
8285
  }
8245
8286
  else {
8246
- if (opt.hasAttribute("aria-selected"))
8287
+ if (opt.hasAttribute("aria-selected")) {
8247
8288
  opt.removeAttribute("aria-selected");
8289
+ opt.removeAttribute("aria-describedby");
8290
+ }
8248
8291
  }
8249
8292
  }
8250
8293
  if (set)
@@ -8358,7 +8401,7 @@ function score(option) {
8358
8401
  }
8359
8402
  function sortOptions(active, state) {
8360
8403
  let options = [];
8361
- let sections = null;
8404
+ let sections = null, dynamicSectionScore = null;
8362
8405
  let addOption = (option) => {
8363
8406
  options.push(option);
8364
8407
  let { section } = option.completion;
@@ -8385,13 +8428,24 @@ function sortOptions(active, state) {
8385
8428
  for (let option of a.result.options)
8386
8429
  if (match = matcher.match(option.label)) {
8387
8430
  let matched = !option.displayLabel ? match.matched : getMatch ? getMatch(option, match.matched) : [];
8388
- addOption(new Option(option, a.source, matched, match.score + (option.boost || 0)));
8431
+ let score = match.score + (option.boost || 0);
8432
+ addOption(new Option(option, a.source, matched, score));
8433
+ if (typeof option.section == "object" && option.section.rank === "dynamic") {
8434
+ let { name } = option.section;
8435
+ if (!dynamicSectionScore)
8436
+ dynamicSectionScore = Object.create(null);
8437
+ dynamicSectionScore[name] = Math.max(score, dynamicSectionScore[name] || -1e9);
8438
+ }
8389
8439
  }
8390
8440
  }
8391
8441
  }
8392
8442
  if (sections) {
8393
8443
  let sectionOrder = Object.create(null), pos = 0;
8394
- let cmp = (a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : 1e9) - ((_b = b.rank) !== null && _b !== void 0 ? _b : 1e9) || (a.name < b.name ? -1 : 1); };
8444
+ let cmp = (a, b) => {
8445
+ return (a.rank === "dynamic" && b.rank === "dynamic" ? dynamicSectionScore[b.name] - dynamicSectionScore[a.name] : 0) ||
8446
+ (typeof a.rank == "number" ? a.rank : 1e9) - (typeof b.rank == "number" ? b.rank : 1e9) ||
8447
+ (a.name < b.name ? -1 : 1);
8448
+ };
8395
8449
  for (let s of sections.sort(cmp)) {
8396
8450
  pos -= 1e5;
8397
8451
  sectionOrder[s.name] = pos;
@@ -8451,7 +8505,7 @@ class CompletionDialog {
8451
8505
  }, prev ? prev.timestamp : Date.now(), selected, false);
8452
8506
  }
8453
8507
  map(changes) {
8454
- return new CompletionDialog(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: changes.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled);
8508
+ return new CompletionDialog(this.options, this.attrs, { ...this.tooltip, pos: changes.mapPos(this.tooltip.pos) }, this.timestamp, this.selected, this.disabled);
8455
8509
  }
8456
8510
  setDisabled() {
8457
8511
  return new CompletionDialog(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, true);
@@ -8636,7 +8690,10 @@ function applyCompletion(view, option) {
8636
8690
  if (!(result instanceof ActiveResult))
8637
8691
  return false;
8638
8692
  if (typeof apply == "string")
8639
- view.dispatch(Object.assign(Object.assign({}, insertCompletionText(view.state, apply, result.from, result.to)), { annotations: pickedCompletion.of(option.completion) }));
8693
+ view.dispatch({
8694
+ ...insertCompletionText(view.state, apply, result.from, result.to),
8695
+ annotations: pickedCompletion.of(option.completion)
8696
+ });
8640
8697
  else
8641
8698
  apply(view, option.completion, result.from, result.to);
8642
8699
  return true;
@@ -9053,7 +9110,7 @@ class Snippet {
9053
9110
  let fields = [];
9054
9111
  let lines = [], positions = [], m;
9055
9112
  for (let line of template.split(/\r\n?|\n/)) {
9056
- while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(line)) {
9113
+ while (m = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(line)) {
9057
9114
  let seq = m[1] ? +m[1] : null, rawName = m[2] || m[3] || "", found = -1;
9058
9115
  let name = rawName.replace(/\\[{}]/g, m => m[1]);
9059
9116
  for (let i = 0; i < fields.length; i++) {
@@ -9070,6 +9127,12 @@ class Snippet {
9070
9127
  if (pos.field >= found)
9071
9128
  pos.field++;
9072
9129
  }
9130
+ for (let pos of positions)
9131
+ if (pos.line == lines.length && pos.from > m.index) {
9132
+ let snip = m[2] ? 3 + (m[1] || "").length : 2;
9133
+ pos.from -= snip;
9134
+ pos.to -= snip;
9135
+ }
9073
9136
  positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));
9074
9137
  line = line.slice(0, m.index) + rawName + line.slice(m.index + m[0].length);
9075
9138
  }
@@ -9099,7 +9162,7 @@ class ActiveSnippet {
9099
9162
  constructor(ranges, active) {
9100
9163
  this.ranges = ranges;
9101
9164
  this.active = active;
9102
- this.deco = view_.Decoration.set(ranges.map(r => (r.from == r.to ? fieldMarker : fieldRange).range(r.from, r.to)));
9165
+ this.deco = view_.Decoration.set(ranges.map(r => (r.from == r.to ? fieldMarker : fieldRange).range(r.from, r.to)), true);
9103
9166
  }
9104
9167
  map(changes) {
9105
9168
  let ranges = [];
@@ -9259,7 +9322,7 @@ properties from `completion`, plus an `apply` function that
9259
9322
  applies the snippet.
9260
9323
  */
9261
9324
  function snippetCompletion(template, completion) {
9262
- return Object.assign(Object.assign({}, completion), { apply: snippet(template) });
9325
+ return { ...completion, apply: snippet(template) };
9263
9326
  }
9264
9327
  const snippetPointerHandler = /*@__PURE__*/view_.EditorView.domEventHandlers({
9265
9328
  mousedown(event, view) {
@@ -9617,17 +9680,18 @@ function autocompletion(config = {}) {
9617
9680
  /**
9618
9681
  Basic keybindings for autocompletion.
9619
9682
 
9620
- - Ctrl-Space (and Alt-\` on macOS): [`startCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.startCompletion)
9683
+ - Ctrl-Space (and Alt-\` or Alt-i on macOS): [`startCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.startCompletion)
9621
9684
  - Escape: [`closeCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.closeCompletion)
9622
9685
  - ArrowDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true)`
9623
9686
  - ArrowUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false)`
9624
9687
  - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, "page")`
9625
- - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, "page")`
9688
+ - PageUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false, "page")`
9626
9689
  - Enter: [`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion)
9627
9690
  */
9628
9691
  const completionKeymap = [
9629
9692
  { key: "Ctrl-Space", run: startCompletion },
9630
9693
  { mac: "Alt-`", run: startCompletion },
9694
+ { mac: "Alt-i", run: startCompletion },
9631
9695
  { key: "Escape", run: closeCompletion },
9632
9696
  { key: "ArrowDown", run: /*@__PURE__*/moveCompletionSelection(true) },
9633
9697
  { key: "ArrowUp", run: /*@__PURE__*/moveCompletionSelection(false) },
@@ -9713,6 +9777,7 @@ class LintState {
9713
9777
  diagnostics = diagnosticFilter(diagnostics, state);
9714
9778
  let sorted = diagnostics.slice().sort((a, b) => a.from - b.from || a.to - b.to);
9715
9779
  let deco = new state_.RangeSetBuilder(), active = [], pos = 0;
9780
+ let scan = state.doc.iter(), scanPos = 0, docLen = state.doc.length;
9716
9781
  for (let i = 0;;) {
9717
9782
  let next = i == sorted.length ? null : sorted[i];
9718
9783
  if (!next && !active.length)
@@ -9724,6 +9789,8 @@ class LintState {
9724
9789
  }
9725
9790
  else {
9726
9791
  from = next.from;
9792
+ if (from > docLen)
9793
+ break;
9727
9794
  to = next.to;
9728
9795
  active.push(next);
9729
9796
  i++;
@@ -9740,8 +9807,31 @@ class LintState {
9740
9807
  break;
9741
9808
  }
9742
9809
  }
9810
+ to = Math.min(to, docLen);
9811
+ let widget = false;
9812
+ if (active.some(d => d.from == from && (d.to == to || to == docLen))) {
9813
+ widget = from == to;
9814
+ if (!widget && to - from < 10) {
9815
+ let behind = from - (scanPos + scan.value.length);
9816
+ if (behind > 0) {
9817
+ scan.next(behind);
9818
+ scanPos = from;
9819
+ }
9820
+ for (let check = from;;) {
9821
+ if (check >= to) {
9822
+ widget = true;
9823
+ break;
9824
+ }
9825
+ if (!scan.lineBreak && scanPos + scan.value.length > check)
9826
+ break;
9827
+ check = scanPos + scan.value.length;
9828
+ scanPos += scan.value.length;
9829
+ scan.next();
9830
+ }
9831
+ }
9832
+ }
9743
9833
  let sev = maxSeverity(active);
9744
- if (active.some(d => d.from == d.to || (d.from == d.to - 1 && state.doc.lineAt(d.from).to == d.from))) {
9834
+ if (widget) {
9745
9835
  deco.add(from, from, view_.Decoration.widget({
9746
9836
  widget: new DiagnosticWidget(sev),
9747
9837
  diagnostics: active.slice()
@@ -9756,6 +9846,8 @@ class LintState {
9756
9846
  }));
9757
9847
  }
9758
9848
  pos = to;
9849
+ if (pos == docLen)
9850
+ break;
9759
9851
  for (let i = 0; i < active.length; i++)
9760
9852
  if (active[i].to <= pos)
9761
9853
  active.splice(i--, 1);
@@ -10008,22 +10100,36 @@ function batchResults(promises, sink, error) {
10008
10100
  }
10009
10101
  const lintConfig = /*@__PURE__*/state_.Facet.define({
10010
10102
  combine(input) {
10011
- return Object.assign({ sources: input.map(i => i.source).filter(x => x != null) }, (0,state_.combineConfig)(input.map(i => i.config), {
10012
- delay: 750,
10013
- markerFilter: null,
10014
- tooltipFilter: null,
10015
- needsRefresh: null,
10016
- hideOn: () => null,
10017
- }, {
10018
- needsRefresh: (a, b) => !a ? b : !b ? a : u => a(u) || b(u)
10019
- }));
10103
+ return {
10104
+ sources: input.map(i => i.source).filter(x => x != null),
10105
+ ...(0,state_.combineConfig)(input.map(i => i.config), {
10106
+ delay: 750,
10107
+ markerFilter: null,
10108
+ tooltipFilter: null,
10109
+ needsRefresh: null,
10110
+ hideOn: () => null,
10111
+ }, {
10112
+ delay: Math.max,
10113
+ markerFilter: combineFilter,
10114
+ tooltipFilter: combineFilter,
10115
+ needsRefresh: (a, b) => !a ? b : !b ? a : u => a(u) || b(u),
10116
+ hideOn: (a, b) => !a ? b : !b ? a : (t, x, y) => a(t, x, y) || b(t, x, y),
10117
+ autoPanel: (a, b) => a || b
10118
+ })
10119
+ };
10020
10120
  }
10021
10121
  });
10122
+ function combineFilter(a, b) {
10123
+ return !a ? b : !b ? a : (d, s) => b(a(d, s), s);
10124
+ }
10022
10125
  /**
10023
10126
  Given a diagnostic source, this function returns an extension that
10024
10127
  enables linting with that source. It will be called whenever the
10025
- editor is idle (after its content changed). If `null` is given as
10026
- source, this only configures the lint extension.
10128
+ editor is idle (after its content changed).
10129
+
10130
+ Note that settings given here will apply to all linters active in
10131
+ the editor. If `null` is given as source, this only configures the
10132
+ lint extension.
10027
10133
  */
10028
10134
  function linter(source, config = {}) {
10029
10135
  return [
@@ -10073,9 +10179,10 @@ function renderDiagnostic(view, diagnostic, inPanel) {
10073
10179
  let nameElt = keyIndex < 0 ? name : [name.slice(0, keyIndex),
10074
10180
  crelt("u", name.slice(keyIndex, keyIndex + 1)),
10075
10181
  name.slice(keyIndex + 1)];
10182
+ let markClass = action.markClass ? " " + action.markClass : "";
10076
10183
  return crelt("button", {
10077
10184
  type: "button",
10078
- class: "cm-diagnosticAction",
10185
+ class: "cm-diagnosticAction" + markClass,
10079
10186
  onclick: click,
10080
10187
  onmousedown: click,
10081
10188
  "aria-label": ` Action: ${name}${keyIndex < 0 ? "" : ` (access key "${keys[i]})"`}.`
@@ -10498,7 +10605,7 @@ const lintGutterTooltip = /*@__PURE__*/state_.StateField.define({
10498
10605
  create() { return null; },
10499
10606
  update(tooltip, tr) {
10500
10607
  if (tooltip && tr.docChanged)
10501
- tooltip = hideTooltip(tr, tooltip) ? null : Object.assign(Object.assign({}, tooltip), { pos: tr.changes.mapPos(tooltip.pos) });
10608
+ tooltip = hideTooltip(tr, tooltip) ? null : { ...tooltip, pos: tr.changes.mapPos(tooltip.pos) };
10502
10609
  return tr.effects.reduce((t, e) => e.is(setLintGutterTooltip) ? e.value : t, tooltip);
10503
10610
  },
10504
10611
  provide: field => view_.showTooltip.from(field)
@@ -10728,7 +10835,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__708__;
10728
10835
  /* harmony export */ cL: () => (/* binding */ historyKeymap),
10729
10836
  /* harmony export */ pw: () => (/* binding */ defaultKeymap)
10730
10837
  /* harmony export */ });
10731
- /* unused harmony exports blockComment, blockUncomment, copyLineDown, copyLineUp, cursorCharBackward, cursorCharBackwardLogical, cursorCharForward, cursorCharForwardLogical, cursorCharLeft, cursorCharRight, cursorDocEnd, cursorDocStart, cursorGroupBackward, cursorGroupForward, cursorGroupForwardWin, cursorGroupLeft, cursorGroupRight, cursorLineBoundaryBackward, cursorLineBoundaryForward, cursorLineBoundaryLeft, cursorLineBoundaryRight, cursorLineDown, cursorLineEnd, cursorLineStart, cursorLineUp, cursorMatchingBracket, cursorPageDown, cursorPageUp, cursorSubwordBackward, cursorSubwordForward, cursorSyntaxLeft, cursorSyntaxRight, deleteCharBackward, deleteCharBackwardStrict, deleteCharForward, deleteGroupBackward, deleteGroupForward, deleteLine, deleteLineBoundaryBackward, deleteLineBoundaryForward, deleteToLineEnd, deleteToLineStart, deleteTrailingWhitespace, emacsStyleKeymap, historyField, indentLess, indentMore, indentSelection, insertBlankLine, insertNewline, insertNewlineAndIndent, insertNewlineKeepIndent, insertTab, invertedEffects, isolateHistory, lineComment, lineUncomment, moveLineDown, moveLineUp, redo, redoDepth, redoSelection, selectAll, selectCharBackward, selectCharBackwardLogical, selectCharForward, selectCharForwardLogical, selectCharLeft, selectCharRight, selectDocEnd, selectDocStart, selectGroupBackward, selectGroupForward, selectGroupForwardWin, selectGroupLeft, selectGroupRight, selectLine, selectLineBoundaryBackward, selectLineBoundaryForward, selectLineBoundaryLeft, selectLineBoundaryRight, selectLineDown, selectLineEnd, selectLineStart, selectLineUp, selectMatchingBracket, selectPageDown, selectPageUp, selectParentSyntax, selectSubwordBackward, selectSubwordForward, selectSyntaxLeft, selectSyntaxRight, simplifySelection, splitLine, standardKeymap, temporarilySetTabFocusMode, toggleBlockComment, toggleBlockCommentByLine, toggleComment, toggleLineComment, toggleTabFocusMode, transposeChars, undo, undoDepth, undoSelection */
10838
+ /* unused harmony exports addCursorAbove, addCursorBelow, blockComment, blockUncomment, copyLineDown, copyLineUp, cursorCharBackward, cursorCharBackwardLogical, cursorCharForward, cursorCharForwardLogical, cursorCharLeft, cursorCharRight, cursorDocEnd, cursorDocStart, cursorGroupBackward, cursorGroupForward, cursorGroupForwardWin, cursorGroupLeft, cursorGroupRight, cursorLineBoundaryBackward, cursorLineBoundaryForward, cursorLineBoundaryLeft, cursorLineBoundaryRight, cursorLineDown, cursorLineEnd, cursorLineStart, cursorLineUp, cursorMatchingBracket, cursorPageDown, cursorPageUp, cursorSubwordBackward, cursorSubwordForward, cursorSyntaxLeft, cursorSyntaxRight, deleteCharBackward, deleteCharBackwardStrict, deleteCharForward, deleteGroupBackward, deleteGroupForward, deleteGroupForwardWin, deleteLine, deleteLineBoundaryBackward, deleteLineBoundaryForward, deleteToLineEnd, deleteToLineStart, deleteTrailingWhitespace, emacsStyleKeymap, historyField, indentLess, indentMore, indentSelection, insertBlankLine, insertNewline, insertNewlineAndIndent, insertNewlineKeepIndent, insertTab, invertedEffects, isolateHistory, lineComment, lineUncomment, moveLineDown, moveLineUp, redo, redoDepth, redoSelection, selectAll, selectCharBackward, selectCharBackwardLogical, selectCharForward, selectCharForwardLogical, selectCharLeft, selectCharRight, selectDocEnd, selectDocStart, selectGroupBackward, selectGroupForward, selectGroupForwardWin, selectGroupLeft, selectGroupRight, selectLine, selectLineBoundaryBackward, selectLineBoundaryForward, selectLineBoundaryLeft, selectLineBoundaryRight, selectLineDown, selectLineEnd, selectLineStart, selectLineUp, selectMatchingBracket, selectPageDown, selectPageUp, selectParentSyntax, selectSubwordBackward, selectSubwordForward, selectSyntaxLeft, selectSyntaxRight, simplifySelection, splitLine, standardKeymap, temporarilySetTabFocusMode, toggleBlockComment, toggleBlockCommentByLine, toggleComment, toggleLineComment, toggleTabFocusMode, transposeChars, undo, undoDepth, undoSelection */
10732
10839
  /* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60);
10733
10840
  /* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(730);
10734
10841
  /* harmony import */ var _codemirror_language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194);
@@ -11822,6 +11929,41 @@ const selectParentSyntax = ({ state, dispatch }) => {
11822
11929
  dispatch(setSel(state, selection));
11823
11930
  return true;
11824
11931
  };
11932
+ function addCursorVertically(view, forward) {
11933
+ let { state } = view, sel = state.selection, ranges = state.selection.ranges.slice();
11934
+ for (let range of state.selection.ranges) {
11935
+ let line = state.doc.lineAt(range.head);
11936
+ if (forward ? line.to < view.state.doc.length : line.from > 0)
11937
+ for (let cur = range;;) {
11938
+ let next = view.moveVertically(cur, forward);
11939
+ if (next.head < line.from || next.head > line.to) {
11940
+ if (!ranges.some(r => r.head == next.head))
11941
+ ranges.push(next);
11942
+ break;
11943
+ }
11944
+ else if (next.head == cur.head) {
11945
+ break;
11946
+ }
11947
+ else {
11948
+ cur = next;
11949
+ }
11950
+ }
11951
+ }
11952
+ if (ranges.length == sel.ranges.length)
11953
+ return false;
11954
+ view.dispatch(setSel(state, _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.create(ranges, ranges.length - 1)));
11955
+ return true;
11956
+ }
11957
+ /**
11958
+ Expand the selection by adding a cursor above the heads of
11959
+ currently selected ranges.
11960
+ */
11961
+ const addCursorAbove = view => addCursorVertically(view, false);
11962
+ /**
11963
+ Expand the selection by adding a cursor below the heads of
11964
+ currently selected ranges.
11965
+ */
11966
+ const addCursorBelow = view => addCursorVertically(view, true);
11825
11967
  /**
11826
11968
  Simplify the current selection. When multiple ranges are selected,
11827
11969
  reduce it to its main range. Otherwise, if the selection is
@@ -11947,6 +12089,12 @@ Delete the selection or forward until the end of the next group.
11947
12089
  */
11948
12090
  const deleteGroupForward = target => deleteByGroup(target, true);
11949
12091
  /**
12092
+ Variant of [`deleteGroupForward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupForward)
12093
+ that uses the Windows convention of also deleting the whitespace
12094
+ after a word.
12095
+ */
12096
+ const deleteGroupForwardWin = view => deleteBy(view, range => view.moveByChar(range, true, start => toGroupStart(view, range.head, start)).head);
12097
+ /**
11950
12098
  Delete the selection, or, if it is a cursor selection, delete to
11951
12099
  the end of the line. If the cursor is directly at the end of the
11952
12100
  line, delete the line break after it.
@@ -12415,12 +12563,12 @@ const standardKeymap = /*@__PURE__*/[
12415
12563
  { key: "Mod-End", run: cursorDocEnd, shift: selectDocEnd },
12416
12564
  { key: "Enter", run: insertNewlineAndIndent, shift: insertNewlineAndIndent },
12417
12565
  { key: "Mod-a", run: selectAll },
12418
- { key: "Backspace", run: deleteCharBackward, shift: deleteCharBackward },
12419
- { key: "Delete", run: deleteCharForward },
12420
- { key: "Mod-Backspace", mac: "Alt-Backspace", run: deleteGroupBackward },
12421
- { key: "Mod-Delete", mac: "Alt-Delete", run: deleteGroupForward },
12422
- { mac: "Mod-Backspace", run: deleteLineBoundaryBackward },
12423
- { mac: "Mod-Delete", run: deleteLineBoundaryForward }
12566
+ { key: "Backspace", run: deleteCharBackward, shift: deleteCharBackward, preventDefault: true },
12567
+ { key: "Delete", run: deleteCharForward, preventDefault: true },
12568
+ { key: "Mod-Backspace", mac: "Alt-Backspace", run: deleteGroupBackward, preventDefault: true },
12569
+ { key: "Mod-Delete", mac: "Alt-Delete", run: deleteGroupForward, preventDefault: true },
12570
+ { mac: "Mod-Backspace", run: deleteLineBoundaryBackward, preventDefault: true },
12571
+ { mac: "Mod-Delete", run: deleteLineBoundaryForward, preventDefault: true }
12424
12572
  ].concat(/*@__PURE__*/emacsStyleKeymap.map(b => ({ mac: b.key, run: b.run, shift: b.shift })));
12425
12573
  /**
12426
12574
  The default keymap. Includes all bindings from
@@ -12432,6 +12580,8 @@ The default keymap. Includes all bindings from
12432
12580
  - Alt-ArrowDown: [`moveLineDown`](https://codemirror.net/6/docs/ref/#commands.moveLineDown)
12433
12581
  - Shift-Alt-ArrowUp: [`copyLineUp`](https://codemirror.net/6/docs/ref/#commands.copyLineUp)
12434
12582
  - Shift-Alt-ArrowDown: [`copyLineDown`](https://codemirror.net/6/docs/ref/#commands.copyLineDown)
12583
+ - Ctrl-Alt-ArrowUp (Cmd-Alt-ArrowUp on macOS): [`addCursorAbove`](https://codemirror.net/6/docs/ref/#commands.addCursorAbove).
12584
+ - Ctrl-Alt-ArrowDown (Cmd-Alt-ArrowDown on macOS): [`addCursorBelow`](https://codemirror.net/6/docs/ref/#commands.addCursorBelow).
12435
12585
  - Escape: [`simplifySelection`](https://codemirror.net/6/docs/ref/#commands.simplifySelection)
12436
12586
  - Ctrl-Enter (Cmd-Enter on macOS): [`insertBlankLine`](https://codemirror.net/6/docs/ref/#commands.insertBlankLine)
12437
12587
  - Alt-l (Ctrl-l on macOS): [`selectLine`](https://codemirror.net/6/docs/ref/#commands.selectLine)
@@ -12452,6 +12602,8 @@ const defaultKeymap = /*@__PURE__*/[
12452
12602
  { key: "Shift-Alt-ArrowUp", run: copyLineUp },
12453
12603
  { key: "Alt-ArrowDown", run: moveLineDown },
12454
12604
  { key: "Shift-Alt-ArrowDown", run: copyLineDown },
12605
+ { key: "Mod-Alt-ArrowUp", run: addCursorAbove },
12606
+ { key: "Mod-Alt-ArrowDown", run: addCursorBelow },
12455
12607
  { key: "Escape", run: simplifySelection },
12456
12608
  { key: "Mod-Enter", run: insertBlankLine },
12457
12609
  { key: "Alt-l", mac: "Ctrl-l", run: selectLine },