Update dev dependencies & CodeMirror

This commit is contained in:
Rob Garrison 2018-11-03 12:12:02 -05:00
parent 5536f7ad22
commit 14144c287c
8 changed files with 9428 additions and 9371 deletions

View File

@ -7,8 +7,8 @@
"author": "Stylus Team",
"devDependencies": {
"archiver": "^3.0.0",
"codemirror": "^5.40.0",
"eslint": "^5.4.0",
"codemirror": "^5.41.0",
"eslint": "^5.8.0",
"fs-extra": "^7.0.0",
"jsonlint": "^1.6.3",
"less": "^3.8.1",
@ -17,7 +17,7 @@
"semver-bundle": "^0.1.1",
"stylelint-bundle": "^8.0.0",
"stylus-lang-bundle": "^0.54.5",
"updates": "^4.2.1",
"updates": "^5.1.2",
"webext-tx-fix": "^0.3.1"
},
"scripts": {

View File

@ -1,3 +1,3 @@
## CodeMirror v5.40.0
## CodeMirror v5.41.0
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

@ -54,7 +54,7 @@ CodeMirror.registerHelper("fold", "brace", function(cm, start) {
++pos;
}
}
if (end == null || line == end && endCh == startCh) return;
if (end == null || line == end) return;
return {from: CodeMirror.Pos(line, startCh),
to: CodeMirror.Pos(end, endCh)};
});

View File

@ -3,7 +3,7 @@
/**
* Supported keybindings:
* Too many to list. Refer to defaultKeyMap below.
* Too many to list. Refer to defaultKeymap below.
*
* Supported Ex commands:
* Refer to defaultExCommandMap below.
@ -207,6 +207,7 @@
// Ex command
{ keys: ':', type: 'ex' }
];
var defaultKeymapLength = defaultKeymap.length;
/**
* Ex commands
@ -742,6 +743,78 @@
unmap: function(lhs, ctx) {
exCommandDispatcher.unmap(lhs, ctx);
},
// Non-recursive map function.
// NOTE: This will not create mappings to key maps that aren't present
// in the default key map. See TODO at bottom of function.
noremap: function(lhs, rhs, ctx) {
function toCtxArray(ctx) {
return ctx ? [ctx] : ['normal', 'insert', 'visual'];
}
var ctxsToMap = toCtxArray(ctx);
// Look through all actual defaults to find a map candidate.
var actualLength = defaultKeymap.length, origLength = defaultKeymapLength;
for (var i = actualLength - origLength;
i < actualLength && ctxsToMap.length;
i++) {
var mapping = defaultKeymap[i];
// Omit mappings that operate in the wrong context(s) and those of invalid type.
if (mapping.keys == rhs &&
(!ctx || !mapping.context || mapping.context === ctx) &&
mapping.type.substr(0, 2) !== 'ex' &&
mapping.type.substr(0, 3) !== 'key') {
// Make a shallow copy of the original keymap entry.
var newMapping = {};
for (var key in mapping) {
newMapping[key] = mapping[key];
}
// Modify it point to the new mapping with the proper context.
newMapping.keys = lhs;
if (ctx && !newMapping.context) {
newMapping.context = ctx;
}
// Add it to the keymap with a higher priority than the original.
this._mapCommand(newMapping);
// Record the mapped contexts as complete.
var mappedCtxs = toCtxArray(mapping.context);
ctxsToMap = ctxsToMap.filter(function(el) { return mappedCtxs.indexOf(el) === -1; });
}
}
// TODO: Create non-recursive keyToKey mappings for the unmapped contexts once those exist.
},
// Remove all user-defined mappings for the provided context.
mapclear: function(ctx) {
// Partition the existing keymap into user-defined and true defaults.
var actualLength = defaultKeymap.length,
origLength = defaultKeymapLength;
var userKeymap = defaultKeymap.slice(0, actualLength - origLength);
defaultKeymap = defaultKeymap.slice(actualLength - origLength);
if (ctx) {
// If a specific context is being cleared, we need to keep mappings
// from all other contexts.
for (var i = userKeymap.length - 1; i >= 0; i--) {
var mapping = userKeymap[i];
if (ctx !== mapping.context) {
if (mapping.context) {
this._mapCommand(mapping);
} else {
// `mapping` applies to all contexts so create keymap copies
// for each context except the one being cleared.
var contexts = ['normal', 'insert', 'visual'];
for (var j in contexts) {
if (contexts[j] !== ctx) {
var newMapping = {};
for (var key in mapping) {
newMapping[key] = mapping[key];
}
newMapping.context = contexts[j];
this._mapCommand(newMapping);
}
}
}
}
}
}
},
// TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace
// them, or somehow make them work with the existing CodeMirror setOption/getOption API.
setOption: setOption,
@ -5040,32 +5113,7 @@
var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.');
var isPlaying = macroModeState.isPlaying;
var lastChange = macroModeState.lastInsertModeChanges;
// In case of visual block, the insertModeChanges are not saved as a
// single word, so we convert them to a single word
// so as to update the ". register as expected in real vim.
var text = [];
if (!isPlaying) {
var selLength = lastChange.inVisualBlock && vim.lastSelection ?
vim.lastSelection.visualBlock.height : 1;
var changes = lastChange.changes;
var text = [];
var i = 0;
// In case of multiple selections in blockwise visual,
// the inserted text, for example: 'f<Backspace>oo', is stored as
// 'f', 'f', InsertModeKey 'o', 'o', 'o', 'o'. (if you have a block with 2 lines).
// We push the contents of the changes array as per the following:
// 1. In case of InsertModeKey, just increment by 1.
// 2. In case of a character, jump by selLength (2 in the example).
while (i < changes.length) {
// This loop will convert 'ff<bs>oooo' to 'f<bs>oo'.
text.push(changes[i]);
if (changes[i] instanceof InsertModeKey) {
i++;
} else {
i+= selLength;
}
}
lastChange.changes = text;
cm.off('change', onChange);
CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
}
@ -5196,17 +5244,24 @@
if (!macroModeState.isPlaying) {
while(changeObj) {
lastChange.expectCursorActivityForChange = true;
if (changeObj.origin == '+input' || changeObj.origin == 'paste'
if (lastChange.ignoreCount > 1) {
lastChange.ignoreCount--;
} else if (changeObj.origin == '+input' || changeObj.origin == 'paste'
|| changeObj.origin === undefined /* only in testing */) {
var selectionCount = cm.listSelections().length;
if (selectionCount > 1)
lastChange.ignoreCount = selectionCount;
var text = changeObj.text.join('\n');
if (lastChange.maybeReset) {
lastChange.changes = [];
lastChange.maybeReset = false;
}
if (cm.state.overwrite && !/\n/.test(text)) {
if (text) {
if (cm.state.overwrite && !/\n/.test(text)) {
lastChange.changes.push([text]);
} else {
} else {
lastChange.changes.push(text);
}
}
}
// Change objects may be chained with next.

File diff suppressed because it is too large Load Diff

View File

@ -501,7 +501,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
"margin-bottom", "margin-left", "margin-right", "margin-top",
"marks", "marquee-direction", "marquee-loop",
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
"max-width", "min-height", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index",
"nav-left", "nav-right", "nav-up", "object-fit", "object-position",
"opacity", "order", "orphans", "outline",
"outline-color", "outline-offset", "outline-style", "outline-width",

View File

@ -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);
}

View File

@ -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; }