Skip to content

Commit 5631d48

Browse files
committed
feature: dword: codemirror v5.65.16
1 parent 4cd145a commit 5631d48

19 files changed

Lines changed: 71 additions & 34 deletions

File tree

modules/codemirror/AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ fraxx001
301301
Fredrik Borg
302302
FUJI Goro (gfx)
303303
fzipp
304+
Gabriela Gutierrez
304305
Gabriel Gheorghian
305306
Gabriel Horner
306307
Gabriel Nahmias
@@ -718,6 +719,7 @@ Panupong Pasupat
718719
paris
719720
Paris
720721
Paris Kasidiaris
722+
Parker Lougheed
721723
Patil Arpith
722724
Patrick Kettner
723725
Patrick Stoica

modules/codemirror/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 5.65.16 (2023-11-20)
2+
3+
### Bug fixes
4+
5+
Fix focus tracking in shadow DOM.
6+
7+
[go mode](https://codemirror.net/5/mode/go/): Allow underscores in numbers.
8+
9+
[jsx mode](https://codemirror.net/5/mode/jsx/index.html): Support TS generics marked by trailing comma.
10+
11+
## 5.65.15 (2023-08-29)
12+
13+
### Bug fixes
14+
15+
[lint addon](https://codemirror.net/5/doc/manual.html#addon_lint): Prevent tooltips from sticking out of the viewport.
16+
17+
[yaml mode](https://codemirror.net/5/mode/yaml/): Fix an exponential-complexity regular expression.
18+
119
## 5.65.14 (2023-07-17)
220

321
### Bug fixes

modules/codemirror/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# CodeMirror
1+
# CodeMirror 5
2+
3+
**NOTE:** [CodeMirror 6](https://codemirror.net/) exists, and is more mobile-friendly, more accessible, better designed, and much more actively maintained.
24

35
[![Build Status](https://github.com/codemirror/codemirror5/workflows/main/badge.svg)](https://github.com/codemirror/codemirror5/actions)
4-
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
56

67
CodeMirror is a versatile text editor implemented in JavaScript for
78
the browser. It is specialized for editing code, and comes with over
@@ -33,7 +34,7 @@ Either get the [zip file](https://codemirror.net/5/codemirror.zip) with
3334
the latest version, or make sure you have [Node](https://nodejs.org/)
3435
installed and run:
3536

36-
npm install codemirror
37+
npm install codemirror@5
3738

3839
**NOTE**: This is the source repository for the library, and not the
3940
distribution channel. Cloning it is not the recommended way to install

modules/codemirror/addon/lint/lint.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424

2525
function position(e) {
2626
if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
27-
tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
28-
tt.style.left = (e.clientX + 5) + "px";
27+
var top = Math.max(0, e.clientY - tt.offsetHeight - 5);
28+
var left = Math.max(0, Math.min(e.clientX + 5, tt.ownerDocument.defaultView.innerWidth - tt.offsetWidth));
29+
tt.style.top = top + "px"
30+
tt.style.left = left + "px";
2931
}
3032
CodeMirror.on(document, "mousemove", position);
3133
position(e);

modules/codemirror/changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* Fix focus tracking in shadow DOM.
2+
* [go mode](https://codemirror.net/5/mode/go/): Allow underscores in numbers.
3+
* [jsx mode](https://codemirror.net/5/mode/jsx/index.html): Support TS generics marked by trailing comma.

modules/codemirror/mode/dart/dart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"implements mixin get native set typedef with enum throw rethrow assert break case " +
1616
"continue default in return new deferred async await covariant try catch finally " +
1717
"do else for if switch while import library export part of show hide is as extension " +
18-
"on yield late required sealed base interface when inline").split(" ");
18+
"on yield late required sealed base interface when").split(" ");
1919
var blockKeywords = "try catch finally do else for if switch while".split(" ");
2020
var atoms = "true false null".split(" ");
2121
var builtins = "void bool num int double dynamic var String Null Never".split(" ");

modules/codemirror/mode/go/go.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ CodeMirror.defineMode("go", function(config) {
4646
}
4747
if (/[\d\.]/.test(ch)) {
4848
if (ch == ".") {
49-
stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
49+
stream.match(/^[0-9_]+([eE][\-+]?[0-9_]+)?/);
5050
} else if (ch == "0") {
51-
stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
51+
stream.match(/^[xX][0-9a-fA-F_]+/) || stream.match(/^[0-7_]+/);
5252
} else {
53-
stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
53+
stream.match(/^[0-9_]*\.?[0-9_]*([eE][\-+]?[0-9_]+)?/);
5454
}
5555
return "number";
5656
}

modules/codemirror/mode/jsx/jsx.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
}
104104

105105
function jsToken(stream, state, cx) {
106-
if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) {
106+
if (stream.peek() == "<" && !stream.match(/^<([^<>]|<[^>]*>)+,\s*>/, false) &&
107+
jsMode.expressionAllowed(stream, cx.state)) {
107108
state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "", "")),
108109
xmlMode, 0, state.context)
109110
jsMode.skipExpression(cx.state)

modules/codemirror/mode/yaml/yaml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ CodeMirror.defineMode("yaml", function() {
8585
}
8686

8787
/* pairs (associative arrays) -> key */
88-
if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) {
88+
if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/)) {
8989
state.pair = true;
9090
state.keyCol = stream.indentation();
9191
return "atom";

modules/codemirror/src/display/operations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { clipPos } from "../line/pos.js"
22
import { findMaxLine } from "../line/spans.js"
33
import { displayWidth, measureChar, scrollGap } from "../measurement/position_measurement.js"
44
import { signal } from "../util/event.js"
5-
import { activeElt, doc } from "../util/dom.js"
5+
import { activeElt, root } from "../util/dom.js"
66
import { finishOperation, pushOperation } from "../util/operation_group.js"
77

88
import { ensureFocus } from "./focus.js"
@@ -116,7 +116,7 @@ function endOperation_W2(op) {
116116
cm.display.maxLineChanged = false
117117
}
118118

119-
let takeFocus = op.focus && op.focus == activeElt(doc(cm))
119+
let takeFocus = op.focus && op.focus == activeElt(root(cm))
120120
if (op.preparedSelection)
121121
cm.display.input.showSelection(op.preparedSelection, takeFocus)
122122
if (op.updatedDisplay || op.startHeight != cm.doc.height)

0 commit comments

Comments
 (0)