Skip to content

Commit

Permalink
chore(package) v12.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jun 6, 2020
1 parent 4515bf5 commit 8617e36
Show file tree
Hide file tree
Showing 24 changed files with 117 additions and 46 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2020.06.06, v12.0.8

feature:
- (package) codemirror v5.54.0
- (package) eslint v7.0.0
- (package) madrun v6.0.0
- (package) putout v8.0.2
- (package) eslint-plugin-putout v4.0.1


2020.04.26, v12.0.7

fix:
Expand Down
7 changes: 7 additions & 0 deletions modules/codemirror/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ aeroson
Ahmad Amireh
Ahmad M. Zawawi
ahoward
Ajin Abraham
Akeksandr Motsjonov
Alasdair Smith
AlbertHilb
Expand Down Expand Up @@ -100,6 +101,7 @@ Bem Jones-Bey
benbro
Benedikt Meurer
benhormann
Ben Hormann
Beni Cherniavsky-Paskin
Benjamin DeCoste
Benjamin Young
Expand All @@ -120,6 +122,7 @@ Bo
boomyjee
Bo Peng
borawjm
Boris K
Brad Metcalf
Brandon Frohs
Brandon Wamboldt
Expand Down Expand Up @@ -216,6 +219,7 @@ Dick Choi
Diego Fernandez
dignifiedquire
Dimage Sapelkin
Dinindu D. Wanniarachchi
dmaclach
Dmitry Kiselyov
domagoj412
Expand Down Expand Up @@ -394,6 +398,7 @@ joelpinheiro
joewalsh
Johan Ask
Johannes
John Chen
John Connor
John-David Dalton
John Engler
Expand Down Expand Up @@ -660,6 +665,7 @@ peter
Peter Flynn
peterkroon
Peter Kroon
Peter László
Philipp A
Philipp Markovics
Philip Stadermann
Expand Down Expand Up @@ -805,6 +811,7 @@ Tim Gates
Timothy Farrell
Timothy Gu
Timothy Hatcher
Tim van der Lippe
Tobias Bertelsen
TobiasBg
Todd Berman
Expand Down
22 changes: 22 additions & 0 deletions modules/codemirror/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## 5.54.0 (2020-05-20)

### Bug fixes

Improve support for having focus inside in-editor widgets in contenteditable-mode.

Fix issue where the scroll position could jump when clicking on a selection in Chrome.

[python mode](https://codemirror.net/mode/python/): Better format string support.

[javascript mode](https://codemirror.net/mode/javascript/): Improve parsing of private properties and class fields.

[matchbrackets addon](https://codemirror.net/doc/manual.html#addon_matchbrackets): Disable highlighting when the editor doesn't have focus.

### New features

[runmode addon](https://codemirror.net/doc/manual.html#addon_runmode): Properly support for cross-line lookahead.

[vim bindings](https://codemirror.net/demo/vim.html): Allow Ex-Commands with non-word names.

[gfm mode](https://codemirror.net/mode/gfm/): Add a `fencedCodeBlockDefaultMode` option.

## 5.53.2 (2020-04-21)

### Bug fixes
Expand Down
12 changes: 10 additions & 2 deletions modules/codemirror/addon/edit/matchbrackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,24 @@
}

CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) {
cm.off("cursorActivity", doMatchBrackets);
function clear(cm) {
if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
cm.state.matchBrackets.currentlyHighlighted();
cm.state.matchBrackets.currentlyHighlighted = null;
}
}

if (old && old != CodeMirror.Init) {
cm.off("cursorActivity", doMatchBrackets);
cm.off("focus", doMatchBrackets)
cm.off("blur", clear)
clear(cm);
}
if (val) {
cm.state.matchBrackets = typeof val == "object" ? val : {};
cm.on("cursorActivity", doMatchBrackets);
cm.on("focus", doMatchBrackets)
cm.on("blur", clear)
}
});

Expand Down
13 changes: 8 additions & 5 deletions modules/codemirror/addon/runmode/runmode-standalone.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE

window.CodeMirror = {};
var root = typeof globalThis !== 'undefined' ? globalThis : window;
root.CodeMirror = {};

(function() {
"use strict";

function splitLines(string){ return string.split(/\r?\n|\r/); };

function StringStream(string) {
function StringStream(strings, i) {
this.pos = this.start = 0;
this.string = string;
this.string = strings[i];
this.strings = strings
this.i = i
this.lineStart = 0;
}
StringStream.prototype = {
Expand Down Expand Up @@ -66,7 +69,7 @@ StringStream.prototype = {
try { return inner(); }
finally { this.lineStart -= n; }
},
lookAhead: function() { return null }
lookAhead: function(n) { return this.strings[this.i + n] }
};
CodeMirror.StringStream = StringStream;

Expand Down Expand Up @@ -150,7 +153,7 @@ CodeMirror.runMode = function (string, modespec, callback, options) {
var lines = splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
for (var i = 0, e = lines.length; i < e; ++i) {
if (i) callback("\n");
var stream = new CodeMirror.StringStream(lines[i]);
var stream = new CodeMirror.StringStream(lines, i);
if (!stream.string && mode.blankLine) mode.blankLine(state);
while (!stream.eol()) {
var style = mode.token(stream, state);
Expand Down
5 changes: 4 additions & 1 deletion modules/codemirror/addon/runmode/runmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ CodeMirror.runMode = function(string, modespec, callback, options) {
var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
for (var i = 0, e = lines.length; i < e; ++i) {
if (i) callback("\n");
var stream = new CodeMirror.StringStream(lines[i]);
var stream = new CodeMirror.StringStream(lines[i], null, {
lookAhead: function(n) { return lines[i + n] },
baseToken: function() {}
});
if (!stream.string && mode.blankLine) mode.blankLine(state);
while (!stream.eol()) {
var style = mode.token(stream, state);
Expand Down
4 changes: 3 additions & 1 deletion modules/codemirror/addon/search/match-highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
var state = cm.state.matchHighlighter;
cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
var searchFor = hasBoundary ? new RegExp("\\b" + query.replace(/[\\\[.+*?(){|^$]/g, "\\$&") + "\\b") : query;
var searchFor = hasBoundary ? new RegExp((/\w/.test(query.charAt(0)) ? "\\b" : "") +
query.replace(/[\\\[.+*?(){|^$]/g, "\\$&") +
(/\w/.test(query.charAt(query.length - 1)) ? "\\b" : "")) : query;
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
{className: "CodeMirror-selection-highlight-scrollbar"});
}
Expand Down
3 changes: 1 addition & 2 deletions modules/codemirror/keymap/vim.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@
{ name: 'undo', shortName: 'u' },
{ name: 'redo', shortName: 'red' },
{ name: 'set', shortName: 'se' },
{ name: 'set', shortName: 'se' },
{ name: 'setlocal', shortName: 'setl' },
{ name: 'setglobal', shortName: 'setg' },
{ name: 'sort', shortName: 'sor' },
Expand Down Expand Up @@ -4457,7 +4456,7 @@
}

// Parse command name.
var commandMatch = inputStream.match(/^(\w+)/);
var commandMatch = inputStream.match(/^(\w+|!!|@@|[!#&*<=>@~])/);
if (commandMatch) {
result.commandName = commandMatch[1];
} else {
Expand Down
10 changes: 5 additions & 5 deletions modules/codemirror/lib/codemirror.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}

.CodeMirror-scroll {
overflow: scroll !important; /* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* 50px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px;
margin-bottom: -50px; margin-right: -50px;
padding-bottom: 50px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
border-right: 50px solid transparent;
}

/* The fake, visible scrollbars. Used to force redraw during scrolling
Expand Down Expand Up @@ -212,7 +212,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
height: 100%;
display: inline-block;
vertical-align: top;
margin-bottom: -30px;
margin-bottom: -50px;
}
.CodeMirror-gutter-wrapper {
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions modules/codemirror/mode/dart/dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"implements mixin get native set typedef with enum throw rethrow " +
"assert break case continue default in return new deferred async await covariant " +
"try catch finally do else for if switch while import library export " +
"part of show hide is as extension on yield").split(" ");
"part of show hide is as extension on yield late required").split(" ");
var blockKeywords = "try catch finally do else for if switch while".split(" ");
var atoms = "true false null".split(" ");
var builtins = "void bool num int double dynamic var String".split(" ");
var builtins = "void bool num int double dynamic var String Null Never".split(" ");

function set(words) {
var obj = {};
Expand Down
15 changes: 9 additions & 6 deletions modules/codemirror/mode/javascript/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (ch == "`") {
state.tokenize = tokenQuasi;
return tokenQuasi(stream, state);
} else if (ch == "#") {
} else if (ch == "#" && stream.peek() == "!") {
stream.skipToEnd();
return ret("error", "error");
return ret("meta", "meta");
} else if (ch == "#" && stream.eatWhile(wordRE)) {
return ret("variable", "property")
} else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) {
stream.skipToEnd()
return ret("comment", "comment")
Expand All @@ -113,6 +115,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (ch == ">") stream.eat(ch)
}
}
if (ch == "?" && stream.eat(".")) return ret(".")
return ret("operator", "operator", stream.current());
} else if (wordRE.test(ch)) {
stream.eatWhile(wordRE);
Expand Down Expand Up @@ -455,7 +458,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
if (type == "operator") {
if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false))
if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
if (value == "?") return cont(expression, expect(":"), expr);
return cont(expr);
Expand Down Expand Up @@ -757,11 +760,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
return cont(isTS ? classfield : functiondef, classBody);
return cont(classfield, classBody);
}
if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody);
if (type == "number" || type == "string") return cont(classfield, classBody);
if (type == "[")
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
return cont(expression, maybetype, expect("]"), classfield, classBody)
if (value == "*") {
cx.marked = "keyword";
return cont(classBody);
Expand Down
5 changes: 4 additions & 1 deletion modules/codemirror/mode/markdown/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {

if (modeCfg.fencedCodeBlockHighlighting === undefined)
modeCfg.fencedCodeBlockHighlighting = true;

if (modeCfg.fencedCodeBlockDefaultMode === undefined)
modeCfg.fencedCodeBlockDefaultMode = '';

if (modeCfg.xml === undefined)
modeCfg.xml = true;
Expand Down Expand Up @@ -236,7 +239,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.quote = 0;
state.fencedEndRE = new RegExp(match[1] + "+ *$");
// try switching mode
state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2]);
state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2] || modeCfg.fencedCodeBlockDefaultMode );
if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
state.f = state.block = local;
if (modeCfg.highlightFormatting) state.formatting = "code-block";
Expand Down
2 changes: 1 addition & 1 deletion modules/codemirror/mode/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]},
{name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
{name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
{name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
{name: "TiddlyWiki", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
Expand Down
8 changes: 4 additions & 4 deletions modules/codemirror/mode/python/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
return tokenBaseInner(stream, state);
}

function tokenBaseInner(stream, state) {
function tokenBaseInner(stream, state, inFormat) {
if (stream.eatSpace()) return null;

// Handle Comments
if (stream.match(/^#.*/)) return "comment";
if (!inFormat && stream.match(/^#.*/)) return "comment";

// Handle Number Literals
if (stream.match(/^[0-9\.]/, false)) {
Expand Down Expand Up @@ -177,7 +177,7 @@

// Handle non-detected items
stream.next();
return ERRORCLASS;
return inFormat ? null :ERRORCLASS;
}

function formatStringFactory(delimiter, tokenOuter) {
Expand All @@ -189,7 +189,7 @@

function tokenNestedExpr(depth) {
return function(stream, state) {
var inner = tokenBaseInner(stream, state)
var inner = tokenBaseInner(stream, state, true)
if (inner == "punctuation") {
if (stream.current() == "{") {
state.tokenize = tokenNestedExpr(depth + 1)
Expand Down
9 changes: 4 additions & 5 deletions modules/codemirror/mode/soy/soy.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@
} else if (peekChar == "[") {
state.soyState.push('param-type-record');
return null;
} else if (peekChar == "<") {
state.soyState.push('param-type-parameter');
return null;
} else if (match = stream.match(/^([\w]+|[?])/)) {
if (match[0] == "map" || match[0] == "list") {
state.soyState.push('param-type-map-list');
}
return "type";
}
stream.next();
Expand All @@ -322,8 +322,7 @@
stream.next();
return null;

case "param-type-map-list":
var peekChar = stream.peek();
case "param-type-parameter":
if (stream.match(/^[>]/)) {
state.soyState.pop();
return null;
Expand Down
3 changes: 2 additions & 1 deletion modules/codemirror/mode/tcl/tcl.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ CodeMirror.defineMode("tcl", function() {
token: function(stream, state) {
if (stream.eatSpace()) return null;
return state.tokenize(stream, state);
}
},
lineComment: "#"
};
});
CodeMirror.defineMIME("text/x-tcl", "tcl");
Expand Down
3 changes: 2 additions & 1 deletion modules/codemirror/src/display/update_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function selectionSnapshot(cm) {
function restoreSelection(snapshot) {
if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) return
snapshot.activeElt.focus()
if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&
snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
let sel = window.getSelection(), range = document.createRange()
range.setEnd(snapshot.anchorNode, snapshot.anchorOffset)
range.collapse(false)
Expand Down
Loading

0 comments on commit 8617e36

Please sign in to comment.