CodeMirror 5.58.2

This commit is contained in:
tophf 2020-10-23 22:35:14 +03:00
parent 2af83ee846
commit 3a615e4e06
7 changed files with 18 additions and 15 deletions

6
package-lock.json generated
View File

@ -1917,9 +1917,9 @@
"dev": true "dev": true
}, },
"codemirror": { "codemirror": {
"version": "5.58.0", "version": "5.58.2",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.58.0.tgz", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.58.2.tgz",
"integrity": "sha512-OUK+7EgaYnLyC0F09UWjckLWvviy02IDDGTW5Zmj60a3gdGnFtUM6rVsqrfl5+YSylQVQBNfAGG4KF7tQOb4/Q==" "integrity": "sha512-K/hOh24cCwRutd1Mk3uLtjWzNISOkm4fvXiMO7LucCrqbh6aJDdtqUziim3MZUI6wOY0rvY1SlL1Ork01uMy6w=="
}, },
"collection-visit": { "collection-visit": {
"version": "1.0.0", "version": "1.0.0",

View File

@ -6,7 +6,7 @@
"repository": "openstyles/stylus", "repository": "openstyles/stylus",
"author": "Stylus Team", "author": "Stylus Team",
"dependencies": { "dependencies": {
"codemirror": "^5.58.0", "codemirror": "^5.58.2",
"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.0 ## codemirror v5.58.2
Following files are copied from npm (node_modules): Following files are copied from npm (node_modules):

View File

@ -3479,14 +3479,15 @@
if (newTop != screentop) { result.scrollTop = newTop; } if (newTop != screentop) { result.scrollTop = newTop; }
} }
var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;
var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;
var screenw = displayWidth(cm) - display.gutters.offsetWidth;
var tooWide = rect.right - rect.left > screenw; var tooWide = rect.right - rect.left > screenw;
if (tooWide) { rect.right = rect.left + screenw; } if (tooWide) { rect.right = rect.left + screenw; }
if (rect.left < 10) if (rect.left < 10)
{ result.scrollLeft = 0; } { result.scrollLeft = 0; }
else if (rect.left < screenleft) else if (rect.left < screenleft)
{ result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); } { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }
else if (rect.right > screenw + screenleft - 3) else if (rect.right > screenw + screenleft - 3)
{ result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }
return result return result
@ -9781,7 +9782,7 @@
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.58.0"; CodeMirror.version = "5.58.2";
return CodeMirror; return CodeMirror;

View File

@ -29,7 +29,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
valueKeywords = parserConfig.valueKeywords || {}, valueKeywords = parserConfig.valueKeywords || {},
allowNested = parserConfig.allowNested, allowNested = parserConfig.allowNested,
lineComment = parserConfig.lineComment, lineComment = parserConfig.lineComment,
supportsAtComponent = parserConfig.supportsAtComponent === true; supportsAtComponent = parserConfig.supportsAtComponent === true,
highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false;
var type, override; var type, override;
function ret(style, tp) { type = tp; return style; } function ret(style, tp) { type = tp; return style; }
@ -197,7 +198,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
override = "property"; override = "property";
return "maybeprop"; return "maybeprop";
} else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
override = "string-2"; override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
return "maybeprop"; return "maybeprop";
} else if (allowNested) { } else if (allowNested) {
override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag"; override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
@ -291,7 +292,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
else if (propertyKeywords.hasOwnProperty(word)) else if (propertyKeywords.hasOwnProperty(word))
override = "property"; override = "property";
else if (nonStandardPropertyKeywords.hasOwnProperty(word)) else if (nonStandardPropertyKeywords.hasOwnProperty(word))
override = "string-2"; override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
else if (valueKeywords.hasOwnProperty(word)) else if (valueKeywords.hasOwnProperty(word))
override = "atom"; override = "atom";
else if (colorKeywords.hasOwnProperty(word)) else if (colorKeywords.hasOwnProperty(word))

View File

@ -126,7 +126,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var kw = keywords[word] var kw = keywords[word]
return ret(kw.type, kw.style, word) return ret(kw.type, kw.style, word)
} }
if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
return ret("async", "keyword", word) return ret("async", "keyword", word)
} }
return ret("variable", "variable", word) return ret("variable", "variable", word)
@ -868,7 +868,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}, },
indent: function(state, textAfter) { indent: function(state, textAfter) {
if (state.tokenize == tokenComment) return CodeMirror.Pass; if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;
if (state.tokenize != tokenBase) return 0; if (state.tokenize != tokenBase) return 0;
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
// Kludge to prevent 'maybelse' from blocking lexical scope pops // Kludge to prevent 'maybelse' from blocking lexical scope pops

File diff suppressed because one or more lines are too long