from official

This commit is contained in:
dana 2018-09-24 05:29:18 -07:00
parent 5a8936e15e
commit 4a37f775dc
5 changed files with 19 additions and 10 deletions

View File

@ -7,7 +7,7 @@
"author": "Stylus Team", "author": "Stylus Team",
"devDependencies": { "devDependencies": {
"archiver": "^3.0.0", "archiver": "^3.0.0",
"codemirror": "^5.40.0", "codemirror": "^5.40.2",
"eslint": "^5.6.0", "eslint": "^5.6.0",
"fs-extra": "^7.0.0", "fs-extra": "^7.0.0",
"jsonlint": "^1.6.3", "jsonlint": "^1.6.3",

View File

@ -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. 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.

View File

@ -1822,7 +1822,7 @@ function buildLineContent(cm, lineView) {
var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
col: 0, pos: 0, cm: cm, col: 0, pos: 0, cm: cm,
trailingSpace: false, trailingSpace: false,
splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; splitSpaces: cm.getOption("lineWrapping")};
lineView.measure = {}; lineView.measure = {};
// Iterate over the logical lines that make up this visual line. // 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); 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) { function splitSpaces(text, trailingBefore) {
if (text.length > 1 && !/ /.test(text)) { return text } if (text.length > 1 && !/ /.test(text)) { return text }
var spaceBefore = trailingBefore, result = ""; var spaceBefore = trailingBefore, result = "";
@ -7254,8 +7256,9 @@ function onMouseDown(e) {
} }
return return
} }
if (clickInGutter(cm, e)) { return } var button = e_button(e);
var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; if (button == 3 && captureRightClick ? contextMenuInGutter(cm, e) : clickInGutter(cm, e)) { return }
var pos = posFromMouse(cm, e), repeat = pos ? clickRepeat(pos, button) : "single";
window.focus(); window.focus();
// #3261: make sure, that we're not starting a second selection // #3261: make sure, that we're not starting a second selection
@ -9695,7 +9698,7 @@ CodeMirror.fromTextArea = fromTextArea;
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.40.0"; CodeMirror.version = "5.40.2";
return CodeMirror; return CodeMirror;

View File

@ -644,7 +644,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) } if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) }
if (type == "variable") { register(value); return cont(); } if (type == "variable") { register(value); return cont(); }
if (type == "spread") return cont(pattern); if (type == "spread") return cont(pattern);
if (type == "[") return contCommasep(pattern, "]"); if (type == "[") return contCommasep(eltpattern, "]");
if (type == "{") return contCommasep(proppattern, "}"); if (type == "{") return contCommasep(proppattern, "}");
} }
function proppattern(type, value) { function proppattern(type, value) {
@ -657,6 +657,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "}") return pass(); if (type == "}") return pass();
return cont(expect(":"), pattern, maybeAssign); return cont(expect(":"), pattern, maybeAssign);
} }
function eltpattern() {
return pass(pattern, maybeAssign)
}
function maybeAssign(_type, value) { function maybeAssign(_type, value) {
if (value == "=") return cont(expressionNoComma); if (value == "=") return cont(expressionNoComma);
} }

View File

@ -12,7 +12,7 @@
.cm-s-gruvbox-dark .CodeMirror-linenumber {color: #7c6f64;} .cm-s-gruvbox-dark .CodeMirror-linenumber {color: #7c6f64;}
.cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; } .cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; }
.cm-s-gruvbox-dark div.CodeMirror-selected { background: #928374; } .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-comment { color: #928374; }
.cm-s-gruvbox-dark span.cm-number, span.cm-atom { color: #d3869b; } .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 { color: #ebdbb2; }
.cm-s-gruvbox-dark span.cm-variable-2 { 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-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-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 { color: #b8bb26; }
.cm-s-gruvbox-dark span.cm-string-2 { color: #8ec07c; } .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 span.cm-attribute { color: #8ec07c; }
.cm-s-gruvbox-dark .CodeMirror-activeline-background { background: #3c3836; } .cm-s-gruvbox-dark .CodeMirror-activeline-background { background: #3c3836; }
.cm-s-gruvbox-dark .CodeMirror-matchingbracket { background: #928374; color:#282828 !important; } .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-builtin { color: #fe8019; }
.cm-s-gruvbox-dark span.cm-tag { color: #fe8019; }