CodeMirror 5.35.1
This commit is contained in:
parent
5acf815b79
commit
513845c289
|
@ -129,8 +129,8 @@
|
||||||
else
|
else
|
||||||
curType = "skip";
|
curType = "skip";
|
||||||
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
} else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
|
||||||
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
|
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {
|
||||||
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
|
if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;
|
||||||
curType = "addFour";
|
curType = "addFour";
|
||||||
} else if (identical) {
|
} else if (identical) {
|
||||||
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
|
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
|
||||||
|
|
13
vendor/codemirror/addon/edit/matchbrackets.js
vendored
13
vendor/codemirror/addon/edit/matchbrackets.js
vendored
|
@ -102,18 +102,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentlyHighlighted = null;
|
|
||||||
function doMatchBrackets(cm) {
|
function doMatchBrackets(cm) {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
if (cm.state.matchBrackets.currentlyHighlighted) {
|
||||||
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
cm.state.matchBrackets.currentlyHighlighted();
|
||||||
|
cm.state.matchBrackets.currentlyHighlighted = null;
|
||||||
|
}
|
||||||
|
cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
||||||
if (old && old != CodeMirror.Init) {
|
if (old && old != CodeMirror.Init) {
|
||||||
cm.off("cursorActivity", doMatchBrackets);
|
cm.off("cursorActivity", doMatchBrackets);
|
||||||
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
|
||||||
|
cm.state.matchBrackets.currentlyHighlighted();
|
||||||
|
cm.state.matchBrackets.currentlyHighlighted = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (val) {
|
if (val) {
|
||||||
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
||||||
|
|
6
vendor/codemirror/addon/lint/lint.js
vendored
6
vendor/codemirror/addon/lint/lint.js
vendored
|
@ -132,7 +132,7 @@
|
||||||
cm.off("change", abort)
|
cm.off("change", abort)
|
||||||
if (state.waitingFor != id) return
|
if (state.waitingFor != id) return
|
||||||
if (arg2 && annotations instanceof CodeMirror) annotations = arg2
|
if (arg2 && annotations instanceof CodeMirror) annotations = arg2
|
||||||
updateLinting(cm, annotations)
|
cm.operation(function() {updateLinting(cm, annotations)})
|
||||||
}, passOptions, cm);
|
}, passOptions, cm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,9 +151,9 @@
|
||||||
var annotations = getAnnotations(cm.getValue(), passOptions, cm);
|
var annotations = getAnnotations(cm.getValue(), passOptions, cm);
|
||||||
if (!annotations) return;
|
if (!annotations) return;
|
||||||
if (annotations.then) annotations.then(function(issues) {
|
if (annotations.then) annotations.then(function(issues) {
|
||||||
updateLinting(cm, issues);
|
cm.operation(function() {updateLinting(cm, issues)})
|
||||||
});
|
});
|
||||||
else updateLinting(cm, annotations);
|
else cm.operation(function() {updateLinting(cm, annotations)})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
var state = cm.state.matchHighlighter;
|
var state = cm.state.matchHighlighter;
|
||||||
cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
|
cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
|
||||||
if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
|
if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
|
||||||
var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
|
var searchFor = hasBoundary ? new RegExp("\\b" + query.replace(/[\\\[.+*?(){|^$]/g, "\\$&") + "\\b") : query;
|
||||||
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
|
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
|
||||||
{className: "CodeMirror-selection-highlight-scrollbar"});
|
{className: "CodeMirror-selection-highlight-scrollbar"});
|
||||||
}
|
}
|
||||||
|
|
18
vendor/codemirror/addon/search/searchcursor.js
vendored
18
vendor/codemirror/addon/search/searchcursor.js
vendored
|
@ -19,8 +19,11 @@
|
||||||
+ (regexp.multiline ? "m" : "")
|
+ (regexp.multiline ? "m" : "")
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensureGlobal(regexp) {
|
function ensureFlags(regexp, flags) {
|
||||||
return regexp.global ? regexp : new RegExp(regexp.source, regexpFlags(regexp) + "g")
|
var current = regexpFlags(regexp), target = current
|
||||||
|
for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)
|
||||||
|
target += flags.charAt(i)
|
||||||
|
return current == target ? regexp : new RegExp(regexp.source, target)
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeMultiline(regexp) {
|
function maybeMultiline(regexp) {
|
||||||
|
@ -28,7 +31,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchRegexpForward(doc, regexp, start) {
|
function searchRegexpForward(doc, regexp, start) {
|
||||||
regexp = ensureGlobal(regexp)
|
regexp = ensureFlags(regexp, "g")
|
||||||
for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {
|
for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {
|
||||||
regexp.lastIndex = ch
|
regexp.lastIndex = ch
|
||||||
var string = doc.getLine(line), match = regexp.exec(string)
|
var string = doc.getLine(line), match = regexp.exec(string)
|
||||||
|
@ -42,7 +45,7 @@
|
||||||
function searchRegexpForwardMultiline(doc, regexp, start) {
|
function searchRegexpForwardMultiline(doc, regexp, start) {
|
||||||
if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)
|
if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)
|
||||||
|
|
||||||
regexp = ensureGlobal(regexp)
|
regexp = ensureFlags(regexp, "gm")
|
||||||
var string, chunk = 1
|
var string, chunk = 1
|
||||||
for (var line = start.line, last = doc.lastLine(); line <= last;) {
|
for (var line = start.line, last = doc.lastLine(); line <= last;) {
|
||||||
// This grows the search buffer in exponentially-sized chunks
|
// This grows the search buffer in exponentially-sized chunks
|
||||||
|
@ -51,6 +54,7 @@
|
||||||
// searching for something that has tons of matches), but at the
|
// searching for something that has tons of matches), but at the
|
||||||
// same time, the amount of retries is limited.
|
// same time, the amount of retries is limited.
|
||||||
for (var i = 0; i < chunk; i++) {
|
for (var i = 0; i < chunk; i++) {
|
||||||
|
if (line > last) break
|
||||||
var curLine = doc.getLine(line++)
|
var curLine = doc.getLine(line++)
|
||||||
string = string == null ? curLine : string + "\n" + curLine
|
string = string == null ? curLine : string + "\n" + curLine
|
||||||
}
|
}
|
||||||
|
@ -81,7 +85,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchRegexpBackward(doc, regexp, start) {
|
function searchRegexpBackward(doc, regexp, start) {
|
||||||
regexp = ensureGlobal(regexp)
|
regexp = ensureFlags(regexp, "g")
|
||||||
for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {
|
for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {
|
||||||
var string = doc.getLine(line)
|
var string = doc.getLine(line)
|
||||||
if (ch > -1) string = string.slice(0, ch)
|
if (ch > -1) string = string.slice(0, ch)
|
||||||
|
@ -94,7 +98,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchRegexpBackwardMultiline(doc, regexp, start) {
|
function searchRegexpBackwardMultiline(doc, regexp, start) {
|
||||||
regexp = ensureGlobal(regexp)
|
regexp = ensureFlags(regexp, "gm")
|
||||||
var string, chunk = 1
|
var string, chunk = 1
|
||||||
for (var line = start.line, first = doc.firstLine(); line >= first;) {
|
for (var line = start.line, first = doc.firstLine(); line >= first;) {
|
||||||
for (var i = 0; i < chunk; i++) {
|
for (var i = 0; i < chunk; i++) {
|
||||||
|
@ -213,7 +217,7 @@
|
||||||
return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)
|
return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
query = ensureGlobal(query)
|
query = ensureFlags(query, "gm")
|
||||||
if (!options || options.multiline !== false)
|
if (!options || options.multiline !== false)
|
||||||
this.matches = function(reverse, pos) {
|
this.matches = function(reverse, pos) {
|
||||||
return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)
|
return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)
|
||||||
|
|
57
vendor/codemirror/keymap/sublime.js
vendored
57
vendor/codemirror/keymap/sublime.js
vendored
|
@ -156,8 +156,14 @@
|
||||||
var ranges = cm.listSelections(), newRanges = [];
|
var ranges = cm.listSelections(), newRanges = [];
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var range = ranges[i];
|
var range = ranges[i];
|
||||||
var newAnchor = cm.findPosV(range.anchor, dir, "line");
|
var newAnchor = cm.findPosV(
|
||||||
var newHead = cm.findPosV(range.head, dir, "line");
|
range.anchor, dir, "line", range.anchor.goalColumn);
|
||||||
|
var newHead = cm.findPosV(
|
||||||
|
range.head, dir, "line", range.head.goalColumn);
|
||||||
|
newAnchor.goalColumn = range.anchor.goalColumn != null ?
|
||||||
|
range.anchor.goalColumn : cm.cursorCoords(range.anchor, "div").left;
|
||||||
|
newHead.goalColumn = range.head.goalColumn != null ?
|
||||||
|
range.head.goalColumn : cm.cursorCoords(range.head, "div").left;
|
||||||
var newRange = {anchor: newAnchor, head: newHead};
|
var newRange = {anchor: newAnchor, head: newHead};
|
||||||
newRanges.push(range);
|
newRanges.push(range);
|
||||||
newRanges.push(newRange);
|
newRanges.push(newRange);
|
||||||
|
@ -183,9 +189,15 @@
|
||||||
var closing = cm.scanForBracket(pos, 1);
|
var closing = cm.scanForBracket(pos, 1);
|
||||||
if (!closing) return false;
|
if (!closing) return false;
|
||||||
if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {
|
if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {
|
||||||
newRanges.push({anchor: Pos(opening.pos.line, opening.pos.ch + 1),
|
var startPos = Pos(opening.pos.line, opening.pos.ch + 1);
|
||||||
head: closing.pos});
|
if (CodeMirror.cmpPos(startPos, range.from()) == 0 &&
|
||||||
break;
|
CodeMirror.cmpPos(closing.pos, range.to()) == 0) {
|
||||||
|
opening = cm.scanForBracket(opening.pos, -1);
|
||||||
|
if (!opening) return false;
|
||||||
|
} else {
|
||||||
|
newRanges.push({anchor: startPos, head: closing.pos});
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pos = Pos(closing.pos.line, closing.pos.ch + 1);
|
pos = Pos(closing.pos.line, closing.pos.ch + 1);
|
||||||
}
|
}
|
||||||
|
@ -376,7 +388,7 @@
|
||||||
var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);
|
var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var from = ranges[i].from(), to = ranges[i].to();
|
var from = ranges[i].from(), to = ranges[i].to();
|
||||||
var found = cm.findMarks(from, to);
|
var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to);
|
||||||
for (var j = 0; j < found.length; j++) {
|
for (var j = 0; j < found.length; j++) {
|
||||||
if (found[j].sublimeBookmark) {
|
if (found[j].sublimeBookmark) {
|
||||||
found[j].clear();
|
found[j].clear();
|
||||||
|
@ -508,27 +520,6 @@
|
||||||
cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);
|
cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);
|
||||||
};
|
};
|
||||||
|
|
||||||
cmds.selectLinesUpward = function(cm) {
|
|
||||||
cm.operation(function() {
|
|
||||||
var ranges = cm.listSelections();
|
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
|
||||||
var range = ranges[i];
|
|
||||||
if (range.head.line > cm.firstLine())
|
|
||||||
cm.addSelection(Pos(range.head.line - 1, range.head.ch));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
cmds.selectLinesDownward = function(cm) {
|
|
||||||
cm.operation(function() {
|
|
||||||
var ranges = cm.listSelections();
|
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
|
||||||
var range = ranges[i];
|
|
||||||
if (range.head.line < cm.lastLine())
|
|
||||||
cm.addSelection(Pos(range.head.line + 1, range.head.ch));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function getTarget(cm) {
|
function getTarget(cm) {
|
||||||
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
||||||
if (CodeMirror.cmpPos(from, to) == 0) {
|
if (CodeMirror.cmpPos(from, to) == 0) {
|
||||||
|
@ -590,8 +581,6 @@
|
||||||
"Cmd-Enter": "insertLineAfter",
|
"Cmd-Enter": "insertLineAfter",
|
||||||
"Shift-Cmd-Enter": "insertLineBefore",
|
"Shift-Cmd-Enter": "insertLineBefore",
|
||||||
"Cmd-D": "selectNextOccurrence",
|
"Cmd-D": "selectNextOccurrence",
|
||||||
"Shift-Cmd-Up": "addCursorToPrevLine",
|
|
||||||
"Shift-Cmd-Down": "addCursorToNextLine",
|
|
||||||
"Shift-Cmd-Space": "selectScope",
|
"Shift-Cmd-Space": "selectScope",
|
||||||
"Shift-Cmd-M": "selectBetweenBrackets",
|
"Shift-Cmd-M": "selectBetweenBrackets",
|
||||||
"Cmd-M": "goToBracket",
|
"Cmd-M": "goToBracket",
|
||||||
|
@ -621,8 +610,8 @@
|
||||||
"Cmd-K Cmd-Backspace": "delLineLeft",
|
"Cmd-K Cmd-Backspace": "delLineLeft",
|
||||||
"Cmd-K Cmd-0": "unfoldAll",
|
"Cmd-K Cmd-0": "unfoldAll",
|
||||||
"Cmd-K Cmd-J": "unfoldAll",
|
"Cmd-K Cmd-J": "unfoldAll",
|
||||||
"Ctrl-Shift-Up": "selectLinesUpward",
|
"Ctrl-Shift-Up": "addCursorToPrevLine",
|
||||||
"Ctrl-Shift-Down": "selectLinesDownward",
|
"Ctrl-Shift-Down": "addCursorToNextLine",
|
||||||
"Cmd-F3": "findUnder",
|
"Cmd-F3": "findUnder",
|
||||||
"Shift-Cmd-F3": "findUnderPrevious",
|
"Shift-Cmd-F3": "findUnderPrevious",
|
||||||
"Alt-F3": "findAllUnder",
|
"Alt-F3": "findAllUnder",
|
||||||
|
@ -652,8 +641,6 @@
|
||||||
"Ctrl-Enter": "insertLineAfter",
|
"Ctrl-Enter": "insertLineAfter",
|
||||||
"Shift-Ctrl-Enter": "insertLineBefore",
|
"Shift-Ctrl-Enter": "insertLineBefore",
|
||||||
"Ctrl-D": "selectNextOccurrence",
|
"Ctrl-D": "selectNextOccurrence",
|
||||||
"Alt-CtrlUp": "addCursorToPrevLine",
|
|
||||||
"Alt-CtrlDown": "addCursorToNextLine",
|
|
||||||
"Shift-Ctrl-Space": "selectScope",
|
"Shift-Ctrl-Space": "selectScope",
|
||||||
"Shift-Ctrl-M": "selectBetweenBrackets",
|
"Shift-Ctrl-M": "selectBetweenBrackets",
|
||||||
"Ctrl-M": "goToBracket",
|
"Ctrl-M": "goToBracket",
|
||||||
|
@ -683,8 +670,8 @@
|
||||||
"Ctrl-K Ctrl-Backspace": "delLineLeft",
|
"Ctrl-K Ctrl-Backspace": "delLineLeft",
|
||||||
"Ctrl-K Ctrl-0": "unfoldAll",
|
"Ctrl-K Ctrl-0": "unfoldAll",
|
||||||
"Ctrl-K Ctrl-J": "unfoldAll",
|
"Ctrl-K Ctrl-J": "unfoldAll",
|
||||||
"Ctrl-Alt-Up": "selectLinesUpward",
|
"Ctrl-Alt-Up": "addCursorToPrevLine",
|
||||||
"Ctrl-Alt-Down": "selectLinesDownward",
|
"Ctrl-Alt-Down": "addCursorToNextLine",
|
||||||
"Ctrl-F3": "findUnder",
|
"Ctrl-F3": "findUnder",
|
||||||
"Shift-Ctrl-F3": "findUnderPrevious",
|
"Shift-Ctrl-F3": "findUnderPrevious",
|
||||||
"Alt-F3": "findAllUnder",
|
"Alt-F3": "findAllUnder",
|
||||||
|
|
52
vendor/codemirror/keymap/vim.js
vendored
52
vendor/codemirror/keymap/vim.js
vendored
|
@ -841,7 +841,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleKeyNonInsertMode() {
|
function handleKeyNonInsertMode() {
|
||||||
if (handleMacroRecording() || handleEsc()) { return true; };
|
if (handleMacroRecording() || handleEsc()) { return true; }
|
||||||
|
|
||||||
var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
|
var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
|
||||||
if (/^[1-9]\d*$/.test(keys)) { return true; }
|
if (/^[1-9]\d*$/.test(keys)) { return true; }
|
||||||
|
@ -1426,7 +1426,7 @@
|
||||||
} else {
|
} else {
|
||||||
if (vim.visualMode) {
|
if (vim.visualMode) {
|
||||||
showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
|
showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
|
||||||
onKeyDown: onPromptKeyDown});
|
onKeyDown: onPromptKeyDown, selectValueOnOpen: false});
|
||||||
} else {
|
} else {
|
||||||
showPrompt(cm, { onClose: onPromptClose, prefix: ':',
|
showPrompt(cm, { onClose: onPromptClose, prefix: ':',
|
||||||
onKeyDown: onPromptKeyDown});
|
onKeyDown: onPromptKeyDown});
|
||||||
|
@ -2637,25 +2637,32 @@
|
||||||
incrementNumberToken: function(cm, actionArgs) {
|
incrementNumberToken: function(cm, actionArgs) {
|
||||||
var cur = cm.getCursor();
|
var cur = cm.getCursor();
|
||||||
var lineStr = cm.getLine(cur.line);
|
var lineStr = cm.getLine(cur.line);
|
||||||
var re = /-?\d+/g;
|
var re = /(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;
|
||||||
var match;
|
var match;
|
||||||
var start;
|
var start;
|
||||||
var end;
|
var end;
|
||||||
var numberStr;
|
var numberStr;
|
||||||
var token;
|
|
||||||
while ((match = re.exec(lineStr)) !== null) {
|
while ((match = re.exec(lineStr)) !== null) {
|
||||||
token = match[0];
|
|
||||||
start = match.index;
|
start = match.index;
|
||||||
end = start + token.length;
|
end = start + match[0].length;
|
||||||
if (cur.ch < end)break;
|
if (cur.ch < end)break;
|
||||||
}
|
}
|
||||||
if (!actionArgs.backtrack && (end <= cur.ch))return;
|
if (!actionArgs.backtrack && (end <= cur.ch))return;
|
||||||
if (token) {
|
if (match) {
|
||||||
|
var baseStr = match[2] || match[4]
|
||||||
|
var digits = match[3] || match[5]
|
||||||
var increment = actionArgs.increase ? 1 : -1;
|
var increment = actionArgs.increase ? 1 : -1;
|
||||||
var number = parseInt(token) + (increment * actionArgs.repeat);
|
var base = {'0b': 2, '0': 8, '': 10, '0x': 16}[baseStr.toLowerCase()];
|
||||||
|
var number = parseInt(match[1] + digits, base) + (increment * actionArgs.repeat);
|
||||||
|
numberStr = number.toString(base);
|
||||||
|
var zeroPadding = baseStr ? new Array(digits.length - numberStr.length + 1 + match[1].length).join('0') : ''
|
||||||
|
if (numberStr.charAt(0) === '-') {
|
||||||
|
numberStr = '-' + baseStr + zeroPadding + numberStr.substr(1);
|
||||||
|
} else {
|
||||||
|
numberStr = baseStr + zeroPadding + numberStr;
|
||||||
|
}
|
||||||
var from = Pos(cur.line, start);
|
var from = Pos(cur.line, start);
|
||||||
var to = Pos(cur.line, end);
|
var to = Pos(cur.line, end);
|
||||||
numberStr = number.toString();
|
|
||||||
cm.replaceRange(numberStr, from, to);
|
cm.replaceRange(numberStr, from, to);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
|
@ -3676,7 +3683,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function splitBySlash(argString) {
|
function splitBySlash(argString) {
|
||||||
var slashes = findUnescapedSlashes(argString) || [];
|
return splitBySeparator(argString, '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
function findUnescapedSlashes(argString) {
|
||||||
|
return findUnescapedSeparators(argString, '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
function splitBySeparator(argString, separator) {
|
||||||
|
var slashes = findUnescapedSeparators(argString, separator) || [];
|
||||||
if (!slashes.length) return [];
|
if (!slashes.length) return [];
|
||||||
var tokens = [];
|
var tokens = [];
|
||||||
// in case of strings like foo/bar
|
// in case of strings like foo/bar
|
||||||
|
@ -3688,12 +3703,15 @@
|
||||||
return tokens;
|
return tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
function findUnescapedSlashes(str) {
|
function findUnescapedSeparators(str, separator) {
|
||||||
|
if (!separator)
|
||||||
|
separator = '/';
|
||||||
|
|
||||||
var escapeNextChar = false;
|
var escapeNextChar = false;
|
||||||
var slashes = [];
|
var slashes = [];
|
||||||
for (var i = 0; i < str.length; i++) {
|
for (var i = 0; i < str.length; i++) {
|
||||||
var c = str.charAt(i);
|
var c = str.charAt(i);
|
||||||
if (!escapeNextChar && c == '/') {
|
if (!escapeNextChar && c == separator) {
|
||||||
slashes.push(i);
|
slashes.push(i);
|
||||||
}
|
}
|
||||||
escapeNextChar = !escapeNextChar && (c == '\\');
|
escapeNextChar = !escapeNextChar && (c == '\\');
|
||||||
|
@ -4559,7 +4577,7 @@
|
||||||
'any other getSearchCursor implementation.');
|
'any other getSearchCursor implementation.');
|
||||||
}
|
}
|
||||||
var argString = params.argString;
|
var argString = params.argString;
|
||||||
var tokens = argString ? splitBySlash(argString) : [];
|
var tokens = argString ? splitBySeparator(argString, argString[0]) : [];
|
||||||
var regexPart, replacePart = '', trailing, flagsPart, count;
|
var regexPart, replacePart = '', trailing, flagsPart, count;
|
||||||
var confirm = false; // Whether to confirm each replace.
|
var confirm = false; // Whether to confirm each replace.
|
||||||
var global = false; // True to replace all instances on a line, false to replace only 1.
|
var global = false; // True to replace all instances on a line, false to replace only 1.
|
||||||
|
@ -4603,7 +4621,7 @@
|
||||||
global = true;
|
global = true;
|
||||||
flagsPart.replace('g', '');
|
flagsPart.replace('g', '');
|
||||||
}
|
}
|
||||||
regexPart = regexPart + '/' + flagsPart;
|
regexPart = regexPart.replace(/\//g, "\\/") + '/' + flagsPart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (regexPart) {
|
if (regexPart) {
|
||||||
|
@ -4819,7 +4837,7 @@
|
||||||
}
|
}
|
||||||
if (!confirm) {
|
if (!confirm) {
|
||||||
replaceAll();
|
replaceAll();
|
||||||
if (callback) { callback(); };
|
if (callback) { callback(); }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showPrompt(cm, {
|
showPrompt(cm, {
|
||||||
|
@ -4955,7 +4973,7 @@
|
||||||
exitInsertMode(cm);
|
exitInsertMode(cm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
macroModeState.isPlaying = false;
|
macroModeState.isPlaying = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5159,7 +5177,7 @@
|
||||||
exitInsertMode(cm);
|
exitInsertMode(cm);
|
||||||
}
|
}
|
||||||
macroModeState.isPlaying = false;
|
macroModeState.isPlaying = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
function repeatInsertModeChanges(cm, changes, repeat) {
|
function repeatInsertModeChanges(cm, changes, repeat) {
|
||||||
function keyHandler(binding) {
|
function keyHandler(binding) {
|
||||||
|
|
2
vendor/codemirror/lib/codemirror.css
vendored
2
vendor/codemirror/lib/codemirror.css
vendored
|
@ -270,7 +270,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||||
.CodeMirror-linewidget {
|
.CodeMirror-linewidget {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
overflow: auto;
|
padding: 0.1px; /* Force widget margins to stay inside of the container */
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-widget {}
|
.CodeMirror-widget {}
|
||||||
|
|
23
vendor/codemirror/lib/codemirror.js
vendored
23
vendor/codemirror/lib/codemirror.js
vendored
|
@ -5212,7 +5212,8 @@ function makeChangeInner(doc, change) {
|
||||||
|
|
||||||
// Revert a change stored in a document's history.
|
// Revert a change stored in a document's history.
|
||||||
function makeChangeFromHistory(doc, type, allowSelectionOnly) {
|
function makeChangeFromHistory(doc, type, allowSelectionOnly) {
|
||||||
if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }
|
var suppress = doc.cm && doc.cm.state.suppressEdits
|
||||||
|
if (suppress && !allowSelectionOnly) { return }
|
||||||
|
|
||||||
var hist = doc.history, event, selAfter = doc.sel
|
var hist = doc.history, event, selAfter = doc.sel
|
||||||
var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done
|
var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done
|
||||||
|
@ -5237,8 +5238,10 @@ function makeChangeFromHistory(doc, type, allowSelectionOnly) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
selAfter = event
|
selAfter = event
|
||||||
}
|
} else if (suppress) {
|
||||||
else { break }
|
source.push(event)
|
||||||
|
return
|
||||||
|
} else { break }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build up a reverse change object to add to the opposite history
|
// Build up a reverse change object to add to the opposite history
|
||||||
|
@ -5714,7 +5717,7 @@ function addLineWidget(doc, handle, node, options) {
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle))
|
if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)) }
|
||||||
return widget
|
return widget
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6573,11 +6576,11 @@ function onResize(cm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var keyNames = {
|
var keyNames = {
|
||||||
3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
|
3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
|
||||||
19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
|
19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
|
||||||
36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
|
36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
|
||||||
46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
|
46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
|
||||||
106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete",
|
106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", 145: "ScrollLock",
|
||||||
173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
|
173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
|
||||||
221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
|
221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
|
||||||
63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
|
63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
|
||||||
|
@ -6724,6 +6727,9 @@ function keyName(event, noShift) {
|
||||||
if (presto && event.keyCode == 34 && event["char"]) { return false }
|
if (presto && event.keyCode == 34 && event["char"]) { return false }
|
||||||
var name = keyNames[event.keyCode]
|
var name = keyNames[event.keyCode]
|
||||||
if (name == null || event.altGraphKey) { return false }
|
if (name == null || event.altGraphKey) { return false }
|
||||||
|
// Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,
|
||||||
|
// so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)
|
||||||
|
if (event.keyCode == 3 && event.code) { name = event.code }
|
||||||
return addModifierNames(name, event, noShift)
|
return addModifierNames(name, event, noShift)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7606,6 +7612,7 @@ function defineOptions(CodeMirror) {
|
||||||
clearCaches(cm)
|
clearCaches(cm)
|
||||||
regChange(cm)
|
regChange(cm)
|
||||||
}, true)
|
}, true)
|
||||||
|
|
||||||
option("lineSeparator", null, function (cm, val) {
|
option("lineSeparator", null, function (cm, val) {
|
||||||
cm.doc.lineSep = val
|
cm.doc.lineSep = val
|
||||||
if (!val) { return }
|
if (!val) { return }
|
||||||
|
@ -8012,7 +8019,7 @@ function applyTextInput(cm, inserted, deleted, sel, origin) {
|
||||||
|
|
||||||
var paste = cm.state.pasteIncoming || origin == "paste"
|
var paste = cm.state.pasteIncoming || origin == "paste"
|
||||||
var textLines = splitLinesAuto(inserted), multiPaste = null
|
var textLines = splitLinesAuto(inserted), multiPaste = null
|
||||||
// When pasing N lines into N selections, insert one line per selection
|
// When pasting N lines into N selections, insert one line per selection
|
||||||
if (paste && sel.ranges.length > 1) {
|
if (paste && sel.ranges.length > 1) {
|
||||||
if (lastCopied && lastCopied.text.join("\n") == inserted) {
|
if (lastCopied && lastCopied.text.join("\n") == inserted) {
|
||||||
if (sel.ranges.length % lastCopied.text.length == 0) {
|
if (sel.ranges.length % lastCopied.text.length == 0) {
|
||||||
|
@ -9646,7 +9653,7 @@ CodeMirror.fromTextArea = fromTextArea
|
||||||
|
|
||||||
addLegacyProps(CodeMirror)
|
addLegacyProps(CodeMirror)
|
||||||
|
|
||||||
CodeMirror.version = "5.32.1"
|
CodeMirror.version = "5.35.1"
|
||||||
|
|
||||||
return CodeMirror;
|
return CodeMirror;
|
||||||
|
|
||||||
|
|
18
vendor/codemirror/mode/css/css.js
vendored
18
vendor/codemirror/mode/css/css.js
vendored
|
@ -77,9 +77,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||||
return ret("qualifier", "qualifier");
|
return ret("qualifier", "qualifier");
|
||||||
} else if (/[:;{}\[\]\(\)]/.test(ch)) {
|
} else if (/[:;{}\[\]\(\)]/.test(ch)) {
|
||||||
return ret(null, ch);
|
return ret(null, ch);
|
||||||
} else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) ||
|
} else if (((ch == "u" || ch == "U") && stream.match(/rl(-prefix)?\(/i)) ||
|
||||||
(ch == "d" && stream.match("omain(")) ||
|
((ch == "d" || ch == "D") && stream.match("omain(", true, true)) ||
|
||||||
(ch == "r" && stream.match("egexp("))) {
|
((ch == "r" || ch == "R") && stream.match("egexp(", true, true))) {
|
||||||
stream.backUp(1);
|
stream.backUp(1);
|
||||||
state.tokenize = tokenParenthesized;
|
state.tokenize = tokenParenthesized;
|
||||||
return ret("property", "word");
|
return ret("property", "word");
|
||||||
|
@ -162,16 +162,16 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||||
return pushContext(state, stream, "block");
|
return pushContext(state, stream, "block");
|
||||||
} else if (type == "}" && state.context.prev) {
|
} else if (type == "}" && state.context.prev) {
|
||||||
return popContext(state);
|
return popContext(state);
|
||||||
} else if (supportsAtComponent && /@component/.test(type)) {
|
} else if (supportsAtComponent && /@component/i.test(type)) {
|
||||||
return pushContext(state, stream, "atComponentBlock");
|
return pushContext(state, stream, "atComponentBlock");
|
||||||
} else if (/^@(-moz-)?document$/.test(type)) {
|
} else if (/^@(-moz-)?document$/i.test(type)) {
|
||||||
return pushContext(state, stream, "documentTypes");
|
return pushContext(state, stream, "documentTypes");
|
||||||
} else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) {
|
} else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {
|
||||||
return pushContext(state, stream, "atBlock");
|
return pushContext(state, stream, "atBlock");
|
||||||
} else if (/^@(font-face|counter-style)/.test(type)) {
|
} else if (/^@(font-face|counter-style)/i.test(type)) {
|
||||||
state.stateArg = type;
|
state.stateArg = type;
|
||||||
return "restricted_atBlock_before";
|
return "restricted_atBlock_before";
|
||||||
} else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
|
} else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {
|
||||||
return "keyframes";
|
return "keyframes";
|
||||||
} else if (type && type.charAt(0) == "@") {
|
} else if (type && type.charAt(0) == "@") {
|
||||||
return pushContext(state, stream, "at");
|
return pushContext(state, stream, "at");
|
||||||
|
@ -793,7 +793,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||||
},
|
},
|
||||||
"@": function(stream) {
|
"@": function(stream) {
|
||||||
if (stream.eat("{")) return [null, "interpolation"];
|
if (stream.eat("{")) return [null, "interpolation"];
|
||||||
if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;
|
if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false)) return false;
|
||||||
stream.eatWhile(/[\w\\\-]/);
|
stream.eatWhile(/[\w\\\-]/);
|
||||||
if (stream.match(/^\s*:/, false))
|
if (stream.match(/^\s*:/, false))
|
||||||
return ["variable-2", "variable-definition"];
|
return ["variable-2", "variable-definition"];
|
||||||
|
|
112
vendor/codemirror/mode/javascript/javascript.js
vendored
112
vendor/codemirror/mode/javascript/javascript.js
vendored
|
@ -26,7 +26,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
|
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
|
||||||
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
|
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
|
||||||
|
|
||||||
var jsKeywords = {
|
return {
|
||||||
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
|
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
|
||||||
"return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
|
"return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
|
||||||
"debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
|
"debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
|
||||||
|
@ -38,33 +38,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
|
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
|
||||||
"await": C
|
"await": C
|
||||||
};
|
};
|
||||||
|
|
||||||
// Extend the 'normal' keywords with the TypeScript language extensions
|
|
||||||
if (isTS) {
|
|
||||||
var type = {type: "variable", style: "type"};
|
|
||||||
var tsKeywords = {
|
|
||||||
// object-like things
|
|
||||||
"interface": kw("class"),
|
|
||||||
"implements": C,
|
|
||||||
"namespace": C,
|
|
||||||
|
|
||||||
// scope modifiers
|
|
||||||
"public": kw("modifier"),
|
|
||||||
"private": kw("modifier"),
|
|
||||||
"protected": kw("modifier"),
|
|
||||||
"abstract": kw("modifier"),
|
|
||||||
"readonly": kw("modifier"),
|
|
||||||
|
|
||||||
// types
|
|
||||||
"string": type, "number": type, "boolean": type, "any": type
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var attr in tsKeywords) {
|
|
||||||
jsKeywords[attr] = tsKeywords[attr];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return jsKeywords;
|
|
||||||
}();
|
}();
|
||||||
|
|
||||||
var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
|
var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
|
||||||
|
@ -310,6 +283,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isModifier(name) {
|
||||||
|
return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"
|
||||||
|
}
|
||||||
|
|
||||||
// Combinators
|
// Combinators
|
||||||
|
|
||||||
var defaultVars = {name: "this", next: {name: "arguments"}};
|
var defaultVars = {name: "this", next: {name: "arguments"}};
|
||||||
|
@ -366,16 +343,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
}
|
}
|
||||||
if (type == "function") return cont(functiondef);
|
if (type == "function") return cont(functiondef);
|
||||||
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
|
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
|
||||||
|
if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), className, poplex); }
|
||||||
if (type == "variable") {
|
if (type == "variable") {
|
||||||
if (isTS && value == "type") {
|
if (isTS && value == "declare") {
|
||||||
cx.marked = "keyword"
|
|
||||||
return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
|
|
||||||
} else if (isTS && value == "declare") {
|
|
||||||
cx.marked = "keyword"
|
cx.marked = "keyword"
|
||||||
return cont(statement)
|
return cont(statement)
|
||||||
} else if (isTS && (value == "module" || value == "enum") && cx.stream.match(/^\s*\w/, false)) {
|
} else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
|
||||||
cx.marked = "keyword"
|
cx.marked = "keyword"
|
||||||
return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
|
if (value == "enum") return cont(enumdef);
|
||||||
|
else if (value == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
|
||||||
|
else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
|
||||||
|
} else if (isTS && value == "namespace") {
|
||||||
|
cx.marked = "keyword"
|
||||||
|
return cont(pushlex("form"), expression, block, poplex)
|
||||||
} else {
|
} else {
|
||||||
return cont(pushlex("stat"), maybelabel);
|
return cont(pushlex("stat"), maybelabel);
|
||||||
}
|
}
|
||||||
|
@ -386,24 +366,23 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
if (type == "default") return cont(expect(":"));
|
if (type == "default") return cont(expect(":"));
|
||||||
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
|
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
|
||||||
statement, poplex, popcontext);
|
statement, poplex, popcontext);
|
||||||
if (type == "class") return cont(pushlex("form"), className, poplex);
|
|
||||||
if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
|
if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
|
||||||
if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
|
if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
|
||||||
if (type == "async") return cont(statement)
|
if (type == "async") return cont(statement)
|
||||||
if (value == "@") return cont(expression, statement)
|
if (value == "@") return cont(expression, statement)
|
||||||
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
||||||
}
|
}
|
||||||
function expression(type) {
|
function expression(type, value) {
|
||||||
return expressionInner(type, false);
|
return expressionInner(type, value, false);
|
||||||
}
|
}
|
||||||
function expressionNoComma(type) {
|
function expressionNoComma(type, value) {
|
||||||
return expressionInner(type, true);
|
return expressionInner(type, value, true);
|
||||||
}
|
}
|
||||||
function parenExpr(type) {
|
function parenExpr(type) {
|
||||||
if (type != "(") return pass()
|
if (type != "(") return pass()
|
||||||
return cont(pushlex(")"), expression, expect(")"), poplex)
|
return cont(pushlex(")"), expression, expect(")"), poplex)
|
||||||
}
|
}
|
||||||
function expressionInner(type, noComma) {
|
function expressionInner(type, value, noComma) {
|
||||||
if (cx.state.fatArrowAt == cx.stream.start) {
|
if (cx.state.fatArrowAt == cx.stream.start) {
|
||||||
var body = noComma ? arrowBodyNoComma : arrowBody;
|
var body = noComma ? arrowBodyNoComma : arrowBody;
|
||||||
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
|
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
|
||||||
|
@ -413,7 +392,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
|
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
|
||||||
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
|
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
|
||||||
if (type == "function") return cont(functiondef, maybeop);
|
if (type == "function") return cont(functiondef, maybeop);
|
||||||
if (type == "class") return cont(pushlex("form"), classExpression, poplex);
|
if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); }
|
||||||
if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
|
if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
|
||||||
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
|
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
|
||||||
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
|
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
|
||||||
|
@ -421,6 +400,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
|
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
|
||||||
if (type == "quasi") return pass(quasi, maybeop);
|
if (type == "quasi") return pass(quasi, maybeop);
|
||||||
if (type == "new") return cont(maybeTarget(noComma));
|
if (type == "new") return cont(maybeTarget(noComma));
|
||||||
|
if (type == "import") return cont(expression);
|
||||||
return cont();
|
return cont();
|
||||||
}
|
}
|
||||||
function maybeexpression(type) {
|
function maybeexpression(type) {
|
||||||
|
@ -511,10 +491,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
return cont(afterprop);
|
return cont(afterprop);
|
||||||
} else if (type == "jsonld-keyword") {
|
} else if (type == "jsonld-keyword") {
|
||||||
return cont(afterprop);
|
return cont(afterprop);
|
||||||
} else if (type == "modifier") {
|
} else if (isTS && isModifier(value)) {
|
||||||
|
cx.marked = "keyword"
|
||||||
return cont(objprop)
|
return cont(objprop)
|
||||||
} else if (type == "[") {
|
} else if (type == "[") {
|
||||||
return cont(expression, expect("]"), afterprop);
|
return cont(expression, maybetype, expect("]"), afterprop);
|
||||||
} else if (type == "spread") {
|
} else if (type == "spread") {
|
||||||
return cont(expressionNoComma, afterprop);
|
return cont(expressionNoComma, afterprop);
|
||||||
} else if (value == "*") {
|
} else if (value == "*") {
|
||||||
|
@ -579,14 +560,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function typeexpr(type, value) {
|
function typeexpr(type, value) {
|
||||||
|
if (value == "keyof" || value == "typeof") {
|
||||||
|
cx.marked = "keyword"
|
||||||
|
return cont(value == "keyof" ? typeexpr : expression)
|
||||||
|
}
|
||||||
if (type == "variable" || value == "void") {
|
if (type == "variable" || value == "void") {
|
||||||
if (value == "keyof") {
|
cx.marked = "type"
|
||||||
cx.marked = "keyword"
|
return cont(afterType)
|
||||||
return cont(typeexpr)
|
|
||||||
} else {
|
|
||||||
cx.marked = "type"
|
|
||||||
return cont(afterType)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
|
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
|
||||||
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
|
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
|
||||||
|
@ -614,9 +594,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
}
|
}
|
||||||
function afterType(type, value) {
|
function afterType(type, value) {
|
||||||
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
||||||
if (value == "|" || type == ".") return cont(typeexpr)
|
if (value == "|" || type == "." || value == "&") return cont(typeexpr)
|
||||||
if (type == "[") return cont(expect("]"), afterType)
|
if (type == "[") return cont(expect("]"), afterType)
|
||||||
if (value == "extends") return cont(typeexpr)
|
if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
|
||||||
}
|
}
|
||||||
function maybeTypeArgs(_, value) {
|
function maybeTypeArgs(_, value) {
|
||||||
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
||||||
|
@ -627,11 +607,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
function maybeTypeDefault(_, value) {
|
function maybeTypeDefault(_, value) {
|
||||||
if (value == "=") return cont(typeexpr)
|
if (value == "=") return cont(typeexpr)
|
||||||
}
|
}
|
||||||
function vardef() {
|
function vardef(_, value) {
|
||||||
|
if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)}
|
||||||
return pass(pattern, maybetype, maybeAssign, vardefCont);
|
return pass(pattern, maybetype, maybeAssign, vardefCont);
|
||||||
}
|
}
|
||||||
function pattern(type, value) {
|
function pattern(type, value) {
|
||||||
if (type == "modifier") 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(pattern, "]");
|
||||||
|
@ -656,7 +637,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
function maybeelse(type, value) {
|
function maybeelse(type, value) {
|
||||||
if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
|
if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
|
||||||
}
|
}
|
||||||
function forspec(type) {
|
function forspec(type, value) {
|
||||||
|
if (value == "await") return cont(forspec);
|
||||||
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
|
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
|
||||||
}
|
}
|
||||||
function forspec1(type) {
|
function forspec1(type) {
|
||||||
|
@ -685,7 +667,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
}
|
}
|
||||||
function funarg(type, value) {
|
function funarg(type, value) {
|
||||||
if (value == "@") cont(expression, funarg)
|
if (value == "@") cont(expression, funarg)
|
||||||
if (type == "spread" || type == "modifier") return cont(funarg);
|
if (type == "spread") return cont(funarg);
|
||||||
|
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
|
||||||
return pass(pattern, maybetype, maybeAssign);
|
return pass(pattern, maybetype, maybeAssign);
|
||||||
}
|
}
|
||||||
function classExpression(type, value) {
|
function classExpression(type, value) {
|
||||||
|
@ -698,14 +681,16 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
}
|
}
|
||||||
function classNameAfter(type, value) {
|
function classNameAfter(type, value) {
|
||||||
if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
|
if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
|
||||||
if (value == "extends" || value == "implements" || (isTS && type == ","))
|
if (value == "extends" || value == "implements" || (isTS && type == ",")) {
|
||||||
|
if (value == "implements") cx.marked = "keyword";
|
||||||
return cont(isTS ? typeexpr : expression, classNameAfter);
|
return cont(isTS ? typeexpr : expression, classNameAfter);
|
||||||
|
}
|
||||||
if (type == "{") return cont(pushlex("}"), classBody, poplex);
|
if (type == "{") return cont(pushlex("}"), classBody, poplex);
|
||||||
}
|
}
|
||||||
function classBody(type, value) {
|
function classBody(type, value) {
|
||||||
if (type == "modifier" || type == "async" ||
|
if (type == "async" ||
|
||||||
(type == "variable" &&
|
(type == "variable" &&
|
||||||
(value == "static" || value == "get" || value == "set") &&
|
(value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
|
||||||
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) {
|
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) {
|
||||||
cx.marked = "keyword";
|
cx.marked = "keyword";
|
||||||
return cont(classBody);
|
return cont(classBody);
|
||||||
|
@ -715,7 +700,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
return cont(isTS ? classfield : functiondef, classBody);
|
return cont(isTS ? classfield : functiondef, classBody);
|
||||||
}
|
}
|
||||||
if (type == "[")
|
if (type == "[")
|
||||||
return cont(expression, expect("]"), isTS ? classfield : functiondef, classBody)
|
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
|
||||||
if (value == "*") {
|
if (value == "*") {
|
||||||
cx.marked = "keyword";
|
cx.marked = "keyword";
|
||||||
return cont(classBody);
|
return cont(classBody);
|
||||||
|
@ -742,6 +727,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
}
|
}
|
||||||
function afterImport(type) {
|
function afterImport(type) {
|
||||||
if (type == "string") return cont();
|
if (type == "string") return cont();
|
||||||
|
if (type == "(") return pass(expression);
|
||||||
return pass(importSpec, maybeMoreImports, maybeFrom);
|
return pass(importSpec, maybeMoreImports, maybeFrom);
|
||||||
}
|
}
|
||||||
function importSpec(type, value) {
|
function importSpec(type, value) {
|
||||||
|
@ -763,6 +749,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
if (type == "]") return cont();
|
if (type == "]") return cont();
|
||||||
return pass(commasep(expressionNoComma, "]"));
|
return pass(commasep(expressionNoComma, "]"));
|
||||||
}
|
}
|
||||||
|
function enumdef() {
|
||||||
|
return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex)
|
||||||
|
}
|
||||||
|
function enummember() {
|
||||||
|
return pass(pattern, maybeAssign);
|
||||||
|
}
|
||||||
|
|
||||||
function isContinuedStatement(state, textAfter) {
|
function isContinuedStatement(state, textAfter) {
|
||||||
return state.lastType == "operator" || state.lastType == "," ||
|
return state.lastType == "operator" || state.lastType == "," ||
|
||||||
|
|
44
vendor/codemirror/theme/oceanic-next.css
vendored
Normal file
44
vendor/codemirror/theme/oceanic-next.css
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
Name: oceanic-next
|
||||||
|
Author: Filype Pereira (https://github.com/fpereira1)
|
||||||
|
|
||||||
|
Original oceanic-next color scheme by Dmitri Voronianski (https://github.com/voronianski/oceanic-next-color-scheme)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
.cm-s-oceanic-next.CodeMirror { background: #304148; color: #f8f8f2; }
|
||||||
|
.cm-s-oceanic-next div.CodeMirror-selected { background: rgba(101, 115, 126, 0.33); }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-line::selection, .cm-s-oceanic-next .CodeMirror-line > span::selection, .cm-s-oceanic-next .CodeMirror-line > span > span::selection { background: rgba(101, 115, 126, 0.33); }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-line::-moz-selection, .cm-s-oceanic-next .CodeMirror-line > span::-moz-selection, .cm-s-oceanic-next .CodeMirror-line > span > span::-moz-selection { background: rgba(101, 115, 126, 0.33); }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-gutters { background: #304148; border-right: 10px; }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-guttermarker { color: white; }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-linenumber { color: #d0d0d0; }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
|
||||||
|
|
||||||
|
.cm-s-oceanic-next span.cm-comment { color: #65737E; }
|
||||||
|
.cm-s-oceanic-next span.cm-atom { color: #C594C5; }
|
||||||
|
.cm-s-oceanic-next span.cm-number { color: #F99157; }
|
||||||
|
|
||||||
|
.cm-s-oceanic-next span.cm-property { color: #99C794; }
|
||||||
|
.cm-s-oceanic-next span.cm-attribute,
|
||||||
|
.cm-s-oceanic-next span.cm-keyword { color: #C594C5; }
|
||||||
|
.cm-s-oceanic-next span.cm-builtin { color: #66d9ef; }
|
||||||
|
.cm-s-oceanic-next span.cm-string { color: #99C794; }
|
||||||
|
|
||||||
|
.cm-s-oceanic-next span.cm-variable,
|
||||||
|
.cm-s-oceanic-next span.cm-variable-2,
|
||||||
|
.cm-s-oceanic-next span.cm-variable-3 { color: #f8f8f2; }
|
||||||
|
.cm-s-oceanic-next span.cm-def { color: #6699CC; }
|
||||||
|
.cm-s-oceanic-next span.cm-bracket { color: #5FB3B3; }
|
||||||
|
.cm-s-oceanic-next span.cm-tag { color: #C594C5; }
|
||||||
|
.cm-s-oceanic-next span.cm-header { color: #C594C5; }
|
||||||
|
.cm-s-oceanic-next span.cm-link { color: #C594C5; }
|
||||||
|
.cm-s-oceanic-next span.cm-error { background: #C594C5; color: #f8f8f0; }
|
||||||
|
|
||||||
|
.cm-s-oceanic-next .CodeMirror-activeline-background { background: rgba(101, 115, 126, 0.33); }
|
||||||
|
.cm-s-oceanic-next .CodeMirror-matchingbracket {
|
||||||
|
text-decoration: underline;
|
||||||
|
color: white !important;
|
||||||
|
}
|
52
vendor/codemirror/theme/shadowfox.css
vendored
Normal file
52
vendor/codemirror/theme/shadowfox.css
vendored
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
Name: shadowfox
|
||||||
|
Author: overdodactyl (http://github.com/overdodactyl)
|
||||||
|
|
||||||
|
Original shadowfox color scheme by Firefox
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
.cm-s-shadowfox.CodeMirror { background: #2a2a2e; color: #b1b1b3; }
|
||||||
|
.cm-s-shadowfox div.CodeMirror-selected { background: #353B48; }
|
||||||
|
.cm-s-shadowfox .CodeMirror-line::selection, .cm-s-shadowfox .CodeMirror-line > span::selection, .cm-s-shadowfox .CodeMirror-line > span > span::selection { background: #353B48; }
|
||||||
|
.cm-s-shadowfox .CodeMirror-line::-moz-selection, .cm-s-shadowfox .CodeMirror-line > span::-moz-selection, .cm-s-shadowfox .CodeMirror-line > span > span::-moz-selection { background: #353B48; }
|
||||||
|
.cm-s-shadowfox .CodeMirror-gutters { background: #0c0c0d ; border-right: 1px solid #0c0c0d; }
|
||||||
|
.cm-s-shadowfox .CodeMirror-guttermarker { color: #555; }
|
||||||
|
.cm-s-shadowfox .CodeMirror-linenumber { color: #939393; }
|
||||||
|
.cm-s-shadowfox .CodeMirror-cursor { border-left: 1px solid #fff; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox span.cm-comment { color: #939393; }
|
||||||
|
.cm-s-shadowfox span.cm-atom { color: #FF7DE9; }
|
||||||
|
.cm-s-shadowfox span.cm-quote { color: #FF7DE9; }
|
||||||
|
.cm-s-shadowfox span.cm-builtin { color: #FF7DE9; }
|
||||||
|
.cm-s-shadowfox span.cm-attribute { color: #FF7DE9; }
|
||||||
|
.cm-s-shadowfox span.cm-keyword { color: #FF7DE9; }
|
||||||
|
.cm-s-shadowfox span.cm-error { color: #FF7DE9; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox span.cm-number { color: #6B89FF; }
|
||||||
|
.cm-s-shadowfox span.cm-string { color: #6B89FF; }
|
||||||
|
.cm-s-shadowfox span.cm-string-2 { color: #6B89FF; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox span.cm-meta { color: #939393; }
|
||||||
|
.cm-s-shadowfox span.cm-hr { color: #939393; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox span.cm-header { color: #75BFFF; }
|
||||||
|
.cm-s-shadowfox span.cm-qualifier { color: #75BFFF; }
|
||||||
|
.cm-s-shadowfox span.cm-variable-2 { color: #75BFFF; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox span.cm-property { color: #86DE74; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox span.cm-def { color: #75BFFF; }
|
||||||
|
.cm-s-shadowfox span.cm-bracket { color: #75BFFF; }
|
||||||
|
.cm-s-shadowfox span.cm-tag { color: #75BFFF; }
|
||||||
|
.cm-s-shadowfox span.cm-link:visited { color: #75BFFF; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox span.cm-variable { color: #B98EFF; }
|
||||||
|
.cm-s-shadowfox span.cm-variable-3 { color: #d7d7db; }
|
||||||
|
.cm-s-shadowfox span.cm-link { color: #737373; }
|
||||||
|
.cm-s-shadowfox span.cm-operator { color: #b1b1b3; }
|
||||||
|
.cm-s-shadowfox span.cm-special { color: #d7d7db; }
|
||||||
|
|
||||||
|
.cm-s-shadowfox .CodeMirror-activeline-background { background: rgba(185, 215, 253, .15) }
|
||||||
|
.cm-s-shadowfox .CodeMirror-matchingbracket { outline: solid 1px rgba(255, 255, 255, .25); color: white !important; }
|
Loading…
Reference in New Issue
Block a user