update CodeMirror 5.58.3

This commit is contained in:
tophf 2020-11-20 09:47:06 +03:00
parent 1bd366beb9
commit 420480887e
5 changed files with 8195 additions and 40 deletions

8204
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
"repository": "openstyles/stylus", "repository": "openstyles/stylus",
"author": "Stylus Team", "author": "Stylus Team",
"dependencies": { "dependencies": {
"codemirror": "^5.58.2", "codemirror": "^5.58.3",
"db-to-cloud": "^0.4.5", "db-to-cloud": "^0.4.5",
"jsonlint": "^1.6.3", "jsonlint": "^1.6.3",
"less-bundle": "github:openstyles/less-bundle#v0.1.0", "less-bundle": "github:openstyles/less-bundle#v0.1.0",

View File

@ -1,4 +1,4 @@
## codemirror v5.58.2 ## codemirror v5.58.3
Following files are copied from npm (node_modules): Following files are copied from npm (node_modules):

View File

@ -3285,19 +3285,22 @@
} }
function ensureFocus(cm) { function ensureFocus(cm) {
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } if (!cm.hasFocus()) {
cm.display.input.focus();
if (!cm.state.focused) { onFocus(cm); }
}
} }
function delayBlurEvent(cm) { function delayBlurEvent(cm) {
cm.state.delayingBlurEvent = true; cm.state.delayingBlurEvent = true;
setTimeout(function () { if (cm.state.delayingBlurEvent) { setTimeout(function () { if (cm.state.delayingBlurEvent) {
cm.state.delayingBlurEvent = false; cm.state.delayingBlurEvent = false;
onBlur(cm); if (cm.state.focused) { onBlur(cm); }
} }, 100); } }, 100);
} }
function onFocus(cm, e) { function onFocus(cm, e) {
if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; } if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }
if (cm.options.readOnly == "nocursor") { return } if (cm.options.readOnly == "nocursor") { return }
if (!cm.state.focused) { if (!cm.state.focused) {
@ -5769,7 +5772,7 @@
changeLine(doc, handle, "widget", function (line) { changeLine(doc, handle, "widget", function (line) {
var widgets = line.widgets || (line.widgets = []); var widgets = line.widgets || (line.widgets = []);
if (widget.insertAt == null) { widgets.push(widget); } if (widget.insertAt == null) { widgets.push(widget); }
else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); } else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }
widget.line = line; widget.line = line;
if (cm && !lineIsHidden(doc, line)) { if (cm && !lineIsHidden(doc, line)) {
var aboveVisible = heightAtLine(line) < doc.scrollTop; var aboveVisible = heightAtLine(line) < doc.scrollTop;
@ -7378,6 +7381,10 @@
var dragEnd = operation(cm, function (e) { var dragEnd = operation(cm, function (e) {
if (webkit) { display.scroller.draggable = false; } if (webkit) { display.scroller.draggable = false; }
cm.state.draggingText = false; cm.state.draggingText = false;
if (cm.state.delayingBlurEvent) {
if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }
else { delayBlurEvent(cm); }
}
off(display.wrapper.ownerDocument, "mouseup", dragEnd); off(display.wrapper.ownerDocument, "mouseup", dragEnd);
off(display.wrapper.ownerDocument, "mousemove", mouseMove); off(display.wrapper.ownerDocument, "mousemove", mouseMove);
off(display.scroller, "dragstart", dragStart); off(display.scroller, "dragstart", dragStart);
@ -7401,15 +7408,15 @@
if (webkit) { display.scroller.draggable = true; } if (webkit) { display.scroller.draggable = true; }
cm.state.draggingText = dragEnd; cm.state.draggingText = dragEnd;
dragEnd.copy = !behavior.moveOnDrag; dragEnd.copy = !behavior.moveOnDrag;
// IE's approach to draggable
if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
on(display.wrapper.ownerDocument, "mouseup", dragEnd); on(display.wrapper.ownerDocument, "mouseup", dragEnd);
on(display.wrapper.ownerDocument, "mousemove", mouseMove); on(display.wrapper.ownerDocument, "mousemove", mouseMove);
on(display.scroller, "dragstart", dragStart); on(display.scroller, "dragstart", dragStart);
on(display.scroller, "drop", dragEnd); on(display.scroller, "drop", dragEnd);
delayBlurEvent(cm); cm.state.delayingBlurEvent = true;
setTimeout(function () { return display.input.focus(); }, 20); setTimeout(function () { return display.input.focus(); }, 20);
// IE's approach to draggable
if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
} }
function rangeForUnit(cm, pos, unit) { function rangeForUnit(cm, pos, unit) {
@ -7422,6 +7429,7 @@
// Normal selection, as opposed to text dragging. // Normal selection, as opposed to text dragging.
function leftButtonSelect(cm, event, start, behavior) { function leftButtonSelect(cm, event, start, behavior) {
if (ie) { delayBlurEvent(cm); }
var display = cm.display, doc = cm.doc; var display = cm.display, doc = cm.doc;
e_preventDefault(event); e_preventDefault(event);
@ -9782,7 +9790,7 @@
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.58.2"; CodeMirror.version = "5.58.3";
return CodeMirror; return CodeMirror;

View File

@ -722,6 +722,9 @@
return indent; return indent;
}, },
electricChars: "}", electricChars: "}",
blockCommentStart: "/*",
blockCommentEnd: "*/",
blockCommentContinue: " * ",
lineComment: "//", lineComment: "//",
fold: "indent" fold: "indent"
}; };