diff --git a/package.json b/package.json index ed0cdab8..c0525e50 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "author": "Stylus Team", "devDependencies": { "archiver": "^3.0.0", - "codemirror": "^5.40.0", + "codemirror": "^5.40.2", "eslint": "^5.6.0", "fs-extra": "^7.0.0", "jsonlint": "^1.6.3", diff --git a/vendor/codemirror/README.md b/vendor/codemirror/README.md index f526c657..f85009ce 100644 --- a/vendor/codemirror/README.md +++ b/vendor/codemirror/README.md @@ -1,3 +1,3 @@ -## CodeMirror v5.40.0 +## CodeMirror v5.40.2 Only files & folders that exist in the `vendor/codemirror` folder are copied from the `node_modules/codemirror` folder. Except all theme files are copied, in case new themes have been added. diff --git a/vendor/codemirror/lib/codemirror.js b/vendor/codemirror/lib/codemirror.js index 96ec6c5f..0363f70d 100644 --- a/vendor/codemirror/lib/codemirror.js +++ b/vendor/codemirror/lib/codemirror.js @@ -1822,7 +1822,7 @@ function buildLineContent(cm, lineView) { var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, col: 0, pos: 0, cm: cm, trailingSpace: false, - splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; + splitSpaces: cm.getOption("lineWrapping")}; lineView.measure = {}; // Iterate over the logical lines that make up this visual line. @@ -1943,6 +1943,8 @@ function buildToken(builder, text, style, startStyle, endStyle, title, css) { builder.content.appendChild(content); } +// Change some spaces to NBSP to prevent the browser from collapsing +// trailing spaces at the end of a line when rendering text (issue #1362). function splitSpaces(text, trailingBefore) { if (text.length > 1 && !/ /.test(text)) { return text } var spaceBefore = trailingBefore, result = ""; @@ -7254,8 +7256,9 @@ function onMouseDown(e) { } return } - if (clickInGutter(cm, e)) { return } - var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; + var button = e_button(e); + if (button == 3 && captureRightClick ? contextMenuInGutter(cm, e) : clickInGutter(cm, e)) { return } + var pos = posFromMouse(cm, e), repeat = pos ? clickRepeat(pos, button) : "single"; window.focus(); // #3261: make sure, that we're not starting a second selection @@ -9695,7 +9698,7 @@ CodeMirror.fromTextArea = fromTextArea; addLegacyProps(CodeMirror); -CodeMirror.version = "5.40.0"; +CodeMirror.version = "5.40.2"; return CodeMirror; diff --git a/vendor/codemirror/mode/javascript/javascript.js b/vendor/codemirror/mode/javascript/javascript.js index a31ffff8..b0a27ceb 100644 --- a/vendor/codemirror/mode/javascript/javascript.js +++ b/vendor/codemirror/mode/javascript/javascript.js @@ -644,7 +644,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) } if (type == "variable") { register(value); return cont(); } if (type == "spread") return cont(pattern); - if (type == "[") return contCommasep(pattern, "]"); + if (type == "[") return contCommasep(eltpattern, "]"); if (type == "{") return contCommasep(proppattern, "}"); } function proppattern(type, value) { @@ -657,6 +657,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "}") return pass(); return cont(expect(":"), pattern, maybeAssign); } + function eltpattern() { + return pass(pattern, maybeAssign) + } function maybeAssign(_type, value) { if (value == "=") return cont(expressionNoComma); } diff --git a/vendor/codemirror/theme/gruvbox-dark.css b/vendor/codemirror/theme/gruvbox-dark.css index 01ca7bb7..ded215f5 100644 --- a/vendor/codemirror/theme/gruvbox-dark.css +++ b/vendor/codemirror/theme/gruvbox-dark.css @@ -12,7 +12,7 @@ .cm-s-gruvbox-dark .CodeMirror-linenumber {color: #7c6f64;} .cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; } .cm-s-gruvbox-dark div.CodeMirror-selected { background: #928374; } -.cm-s-gruvbox-dark span.cm-meta { color: #808000; } +.cm-s-gruvbox-dark span.cm-meta { color: #83a598; } .cm-s-gruvbox-dark span.cm-comment { color: #928374; } .cm-s-gruvbox-dark span.cm-number, span.cm-atom { color: #d3869b; } @@ -20,15 +20,18 @@ .cm-s-gruvbox-dark span.cm-variable { color: #ebdbb2; } .cm-s-gruvbox-dark span.cm-variable-2 { color: #ebdbb2; } -.cm-s-gruvbox-dark span.cm-variable-3, .cm-s-gruvbox-dark span.cm-type { color: black; } +.cm-s-gruvbox-dark span.cm-variable-3, .cm-s-gruvbox-dark span.cm-type { color: #fabd2f; } .cm-s-gruvbox-dark span.cm-operator { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-callee { color: #ebdbb2; } .cm-s-gruvbox-dark span.cm-def { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-property { color: #ebdbb2; } .cm-s-gruvbox-dark span.cm-string { color: #b8bb26; } .cm-s-gruvbox-dark span.cm-string-2 { color: #8ec07c; } -.cm-s-gruvbox-dark span.cm-qualifier { color: #555; } +.cm-s-gruvbox-dark span.cm-qualifier { color: #8ec07c; } .cm-s-gruvbox-dark span.cm-attribute { color: #8ec07c; } .cm-s-gruvbox-dark .CodeMirror-activeline-background { background: #3c3836; } .cm-s-gruvbox-dark .CodeMirror-matchingbracket { background: #928374; color:#282828 !important; } .cm-s-gruvbox-dark span.cm-builtin { color: #fe8019; } +.cm-s-gruvbox-dark span.cm-tag { color: #fe8019; }