Fix #16793 - Upgrade CodeMirror from 5.60.0 to 5.61.0
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
af4dda0fd8
commit
28b642747a
2
js/vendor/codemirror/addon/hint/show-hint.js
vendored
2
js/vendor/codemirror/addon/hint/show-hint.js
vendored
@ -293,6 +293,7 @@
|
||||
}
|
||||
}
|
||||
var overlapX = box.right - winW;
|
||||
if (scrolls) overlapX += cm.display.nativeBarWidth;
|
||||
if (overlapX > 0) {
|
||||
if (box.right - box.left > winW) {
|
||||
hints.style.width = (winW - 5) + "px";
|
||||
@ -321,6 +322,7 @@
|
||||
|
||||
cm.on("scroll", this.onScroll = function() {
|
||||
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
|
||||
if (!startScroll) startScroll = cm.getScrollInfo();
|
||||
var newTop = top + startScroll.top - curScroll.top;
|
||||
var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);
|
||||
if (!below) point += hints.offsetHeight;
|
||||
|
||||
@ -67,7 +67,7 @@ CodeMirror.runMode = function(string, modespec, callback, options) {
|
||||
if (!stream.string && mode.blankLine) mode.blankLine(state);
|
||||
while (!stream.eol()) {
|
||||
var style = mode.token(stream, state);
|
||||
callback(stream.current(), style, i, stream.start, state);
|
||||
callback(stream.current(), style, i, stream.start, state, mode);
|
||||
stream.start = stream.pos;
|
||||
}
|
||||
}
|
||||
|
||||
18
js/vendor/codemirror/lib/codemirror.js
vendored
18
js/vendor/codemirror/lib/codemirror.js
vendored
@ -2186,6 +2186,7 @@
|
||||
if (cm.options.lineNumbers || markers) {
|
||||
var wrap$1 = ensureLineWrapped(lineView);
|
||||
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"));
|
||||
gutterWrap.setAttribute("aria-hidden", "true");
|
||||
cm.display.input.setUneditable(gutterWrap);
|
||||
wrap$1.insertBefore(gutterWrap, lineView.text);
|
||||
if (lineView.line.gutterClass)
|
||||
@ -4235,6 +4236,8 @@
|
||||
function updateGutterSpace(display) {
|
||||
var width = display.gutters.offsetWidth;
|
||||
display.sizer.style.marginLeft = width + "px";
|
||||
// Send an event to consumers responding to changes in gutter width.
|
||||
signalLater(display, "gutterChanged", display);
|
||||
}
|
||||
|
||||
function setDocumentHeight(cm, measure) {
|
||||
@ -6684,10 +6687,9 @@
|
||||
// Very basic readline/emacs-style bindings, which are standard on Mac.
|
||||
keyMap.emacsy = {
|
||||
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
|
||||
"Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
|
||||
"Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
|
||||
"Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
|
||||
"Ctrl-O": "openLine"
|
||||
"Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp",
|
||||
"Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine",
|
||||
"Ctrl-T": "transposeChars", "Ctrl-O": "openLine"
|
||||
};
|
||||
keyMap.macDefault = {
|
||||
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
|
||||
@ -8833,7 +8835,7 @@
|
||||
var kludge = hiddenTextarea(), te = kludge.firstChild;
|
||||
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
|
||||
te.value = lastCopied.text.join("\n");
|
||||
var hadFocus = document.activeElement;
|
||||
var hadFocus = activeElt();
|
||||
selectInput(te);
|
||||
setTimeout(function () {
|
||||
cm.display.lineSpace.removeChild(kludge);
|
||||
@ -8856,7 +8858,7 @@
|
||||
|
||||
ContentEditableInput.prototype.prepareSelection = function () {
|
||||
var result = prepareSelection(this.cm, false);
|
||||
result.focus = document.activeElement == this.div;
|
||||
result.focus = activeElt() == this.div;
|
||||
return result
|
||||
};
|
||||
|
||||
@ -8952,7 +8954,7 @@
|
||||
|
||||
ContentEditableInput.prototype.focus = function () {
|
||||
if (this.cm.options.readOnly != "nocursor") {
|
||||
if (!this.selectionInEditor() || document.activeElement != this.div)
|
||||
if (!this.selectionInEditor() || activeElt() != this.div)
|
||||
{ this.showSelection(this.prepareSelection(), true); }
|
||||
this.div.focus();
|
||||
}
|
||||
@ -9794,7 +9796,7 @@
|
||||
|
||||
addLegacyProps(CodeMirror);
|
||||
|
||||
CodeMirror.version = "5.60.0";
|
||||
CodeMirror.version = "5.61.0";
|
||||
|
||||
return CodeMirror;
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
var statementIndent = parserConfig.statementIndent;
|
||||
var jsonldMode = parserConfig.jsonld;
|
||||
var jsonMode = parserConfig.json || jsonldMode;
|
||||
var trackScope = parserConfig.trackScope !== false
|
||||
var isTS = parserConfig.typescript;
|
||||
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
|
||||
|
||||
@ -231,6 +232,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
}
|
||||
|
||||
function inScope(state, varname) {
|
||||
if (!trackScope) return false
|
||||
for (var v = state.localVars; v; v = v.next)
|
||||
if (v.name == varname) return true;
|
||||
for (var cx = state.context; cx; cx = cx.prev) {
|
||||
@ -277,6 +279,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
function register(varname) {
|
||||
var state = cx.state;
|
||||
cx.marked = "def";
|
||||
if (!trackScope) return
|
||||
if (state.context) {
|
||||
if (state.lexical.info == "var" && state.context && state.context.block) {
|
||||
// FIXME function decls are also not block scoped
|
||||
@ -376,7 +379,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
|
||||
}
|
||||
if (type == "function") return cont(functiondef);
|
||||
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
|
||||
if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
|
||||
if (type == "class" || (isTS && value == "interface")) {
|
||||
cx.marked = "keyword"
|
||||
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
|
||||
@ -883,7 +886,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
|
||||
var c = state.cc[i];
|
||||
if (c == poplex) lexical = lexical.prev;
|
||||
else if (c != maybeelse) break;
|
||||
else if (c != maybeelse && c != popcontext) break;
|
||||
}
|
||||
while ((lexical.type == "stat" || lexical.type == "form") &&
|
||||
(firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"@babel/preset-env": "^7.13.12",
|
||||
"blueimp-md5": "^2.18.0",
|
||||
"bootstrap": "4.5.3",
|
||||
"codemirror": "5.60.0",
|
||||
"codemirror": "5.61.0",
|
||||
"jquery": "3.5.1",
|
||||
"jquery-debounce-throttle": "^1.0.6-rc.0",
|
||||
"jquery-fullscreen-plugin": "^1.1.5",
|
||||
|
||||
@ -2402,10 +2402,10 @@ co@^4.6.0:
|
||||
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
|
||||
integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=
|
||||
|
||||
codemirror@5.60.0:
|
||||
version "5.60.0"
|
||||
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.60.0.tgz#00a8cfd287d5d8737ceb73987f04aee2fe5860da"
|
||||
integrity sha512-AEL7LhFOlxPlCL8IdTcJDblJm8yrAGib7I+DErJPdZd4l6imx8IMgKK3RblVgBQqz3TZJR4oknQ03bz+uNjBYA==
|
||||
codemirror@5.61.0:
|
||||
version "5.61.0"
|
||||
resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.61.0.tgz#318e5b034a707207948b92ffc2862195e8fdb08e"
|
||||
integrity sha512-D3wYH90tYY1BsKlUe0oNj2JAhQ9TepkD51auk3N7q+4uz7A/cgJ5JsWHreT0PqieW1QhOuqxQ2reCXV1YXzecg==
|
||||
|
||||
collect-v8-coverage@^1.0.0:
|
||||
version "1.0.1"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user