codemirror
Advanced tools
Comparing version 5.58.1 to 5.58.2
@@ -190,3 +190,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
for (var i = 0; i < words.length; i++) | ||
if (words[i]) f(words[i].replace(/[,;]/g, '')) | ||
if (words[i]) f(words[i].replace(/[`,;]/g, '')) | ||
} | ||
@@ -193,0 +193,0 @@ |
@@ -32,3 +32,4 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
lineComment = parserConfig.lineComment, | ||
supportsAtComponent = parserConfig.supportsAtComponent === true; | ||
supportsAtComponent = parserConfig.supportsAtComponent === true, | ||
highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false; | ||
@@ -201,3 +202,3 @@ var type, override; | ||
} else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { | ||
override = "string-2"; | ||
override = highlightNonStandardPropertyKeywords ? "string-2" : "property"; | ||
return "maybeprop"; | ||
@@ -296,3 +297,3 @@ } else if (allowNested) { | ||
else if (nonStandardPropertyKeywords.hasOwnProperty(word)) | ||
override = "string-2"; | ||
override = highlightNonStandardPropertyKeywords ? "string-2" : "property"; | ||
else if (valueKeywords.hasOwnProperty(word)) | ||
@@ -299,0 +300,0 @@ override = "atom"; |
@@ -129,3 +129,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
} | ||
if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) | ||
if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false)) | ||
return ret("async", "keyword", word) | ||
@@ -872,3 +872,3 @@ } | ||
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; | ||
@@ -875,0 +875,0 @@ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top |
@@ -258,37 +258,39 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
function tokenCallOrDef(stream, state) { | ||
var match = stream.match(/^(\(\s*)/); | ||
if (match) { | ||
if (state.firstParenPos < 0) | ||
state.firstParenPos = state.scopes.length; | ||
state.scopes.push('('); | ||
state.charsAdvanced += match[1].length; | ||
} | ||
if (currentScope(state) == '(' && stream.match(/^\)/)) { | ||
state.scopes.pop(); | ||
state.charsAdvanced += 1; | ||
if (state.scopes.length <= state.firstParenPos) { | ||
var isDefinition = stream.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/, false); | ||
stream.backUp(state.charsAdvanced); | ||
for (;;) { | ||
var match = stream.match(/^(\(\s*)/), charsAdvanced = 0; | ||
if (match) { | ||
if (state.firstParenPos < 0) | ||
state.firstParenPos = state.scopes.length; | ||
state.scopes.push('('); | ||
charsAdvanced += match[1].length; | ||
} | ||
if (currentScope(state) == '(' && stream.match(/^\)/)) { | ||
state.scopes.pop(); | ||
charsAdvanced += 1; | ||
if (state.scopes.length <= state.firstParenPos) { | ||
var isDefinition = stream.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/, false); | ||
stream.backUp(charsAdvanced); | ||
state.firstParenPos = -1; | ||
state.tokenize = tokenBase; | ||
if (isDefinition) | ||
return "def"; | ||
return "builtin"; | ||
} | ||
} | ||
// Unfortunately javascript does not support multiline strings, so we have | ||
// to undo anything done upto here if a function call or definition splits | ||
// over two or more lines. | ||
if (stream.match(/^$/g, false)) { | ||
stream.backUp(charsAdvanced); | ||
while (state.scopes.length > state.firstParenPos) | ||
state.scopes.pop(); | ||
state.firstParenPos = -1; | ||
state.charsAdvanced = 0; | ||
state.tokenize = tokenBase; | ||
if (isDefinition) | ||
return "def"; | ||
return "builtin"; | ||
} | ||
if (!stream.match(/^[^()]+/)) { | ||
stream.next() | ||
return null | ||
} | ||
} | ||
// Unfortunately javascript does not support multiline strings, so we have | ||
// to undo anything done upto here if a function call or definition splits | ||
// over two or more lines. | ||
if (stream.match(/^$/g, false)) { | ||
stream.backUp(state.charsAdvanced); | ||
while (state.scopes.length > state.firstParenPos) | ||
state.scopes.pop(); | ||
state.firstParenPos = -1; | ||
state.charsAdvanced = 0; | ||
state.tokenize = tokenBase; | ||
return "builtin"; | ||
} | ||
state.charsAdvanced += stream.match(/^([^()]*)/)[1].length; | ||
return state.tokenize(stream, state); | ||
} | ||
@@ -387,3 +389,2 @@ | ||
nestedParameters: 0, | ||
charsAdvanced: 0, | ||
firstParenPos: -1 | ||
@@ -390,0 +391,0 @@ }; |
@@ -172,3 +172,4 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
{name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]}, | ||
{name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]} | ||
{name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]}, | ||
{name: "WebAssembly", mime: "text/webassembly", mode: "wast", ext: ["wat", "wast"]}, | ||
]; | ||
@@ -175,0 +176,0 @@ // Ensure all modes have a mime property for backwards compatibility |
@@ -63,2 +63,8 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
} | ||
else if (ch === "^") { | ||
ch = stream.peek(); | ||
if (ch === "^") stream.eat("^"); | ||
else stream.eatWhile(operatorChars); | ||
return "operator"; | ||
} | ||
else if (operatorChars.test(ch)) { | ||
@@ -69,3 +75,3 @@ stream.eatWhile(operatorChars); | ||
else if (ch == ":") { | ||
stream.eatWhile(/[\w\d\._\-]/); | ||
eatPnLocal(stream); | ||
return "atom"; | ||
@@ -80,3 +86,3 @@ } | ||
if (stream.eat(":")) { | ||
stream.eatWhile(/[\w\d_\-]/); | ||
eatPnLocal(stream); | ||
return "atom"; | ||
@@ -94,2 +100,6 @@ } | ||
function eatPnLocal(stream) { | ||
while (stream.match(/([:\w\d._-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-fA-F0-9][a-fA-F0-9])/)); | ||
} | ||
function tokenLiteral(quote) { | ||
@@ -96,0 +106,0 @@ return function(stream, state) { |
@@ -734,3 +734,4 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
// github.com/codemirror/CodeMirror/blob/master/mode/css/css.js | ||
var documentTypes_ = ["domain", "regexp", "url", "url-prefix"]; | ||
// Note, "url-prefix" should precede "url" in order to match correctly in documentTypesRegexp | ||
var documentTypes_ = ["domain", "regexp", "url-prefix", "url"]; | ||
var mediaTypes_ = ["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]; | ||
@@ -737,0 +738,0 @@ var mediaFeatures_ = ["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]; |
{ | ||
"name": "codemirror", | ||
"version": "5.58.1", | ||
"version": "5.58.2", | ||
"main": "lib/codemirror.js", | ||
@@ -5,0 +5,0 @@ "style": "lib/codemirror.css", |
@@ -5,3 +5,2 @@ # CodeMirror | ||
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror) | ||
[![Join the chat at https://gitter.im/codemirror/CodeMirror](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/codemirror/CodeMirror) | ||
@@ -8,0 +7,0 @@ CodeMirror is a versatile text editor implemented in JavaScript for |
@@ -94,4 +94,5 @@ import { Pos } from "../line/pos.js" | ||
let screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft | ||
let screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0) | ||
let gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth | ||
let screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace | ||
let screenw = displayWidth(cm) - display.gutters.offsetWidth | ||
let tooWide = rect.right - rect.left > screenw | ||
@@ -102,3 +103,3 @@ if (tooWide) rect.right = rect.left + screenw | ||
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) | ||
@@ -105,0 +106,0 @@ result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw |
@@ -69,2 +69,2 @@ // EDITOR CONSTRUCTOR | ||
CodeMirror.version = "5.58.1" | ||
CodeMirror.version = "5.58.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2881326
65023
48