Update CodeMirror to version 5.15.3
This commit is contained in:
parent
16d5e3ea80
commit
fb70833bc5
41 changed files with 834 additions and 310 deletions
public/vendor/codemirror
addon
edit
fold
hint
lint
scroll
search
keymap
lib
mode
clike
clojure
css
ebnf
fortran
haml
htmlembedded
htmlmixed
index.htmljade
javascript
markdown
mbox
meta.jspegjs
php
python
slim
webidl
yacas
theme
|
@ -109,7 +109,7 @@
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
var opening = pos % 2 == 0;
|
var opening = pos % 2 == 0;
|
||||||
|
|
||||||
var type, next;
|
var type;
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var range = ranges[i], cur = range.head, curType;
|
var range = ranges[i], cur = range.head, curType;
|
||||||
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
CodeMirror.registerHelper("fold", "brace", function(cm, start) {
|
CodeMirror.registerHelper("fold", "brace", function(cm, start) {
|
||||||
var line = start.line, lineText = cm.getLine(line);
|
var line = start.line, lineText = cm.getLine(line);
|
||||||
var startCh, tokenType;
|
var tokenType;
|
||||||
|
|
||||||
function findOpening(openCh) {
|
function findOpening(openCh) {
|
||||||
for (var at = start.ch, pass = 0;;) {
|
for (var at = start.ch, pass = 0;;) {
|
||||||
|
@ -72,15 +72,15 @@ CodeMirror.registerHelper("fold", "import", function(cm, start) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var start = start.line, has = hasImport(start), prev;
|
var startLine = start.line, has = hasImport(startLine), prev;
|
||||||
if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1))
|
if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1))
|
||||||
return null;
|
return null;
|
||||||
for (var end = has.end;;) {
|
for (var end = has.end;;) {
|
||||||
var next = hasImport(end.line + 1);
|
var next = hasImport(end.line + 1);
|
||||||
if (next == null) break;
|
if (next == null) break;
|
||||||
end = next.end;
|
end = next.end;
|
||||||
}
|
}
|
||||||
return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end};
|
return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end};
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.registerHelper("fold", "include", function(cm, start) {
|
CodeMirror.registerHelper("fold", "include", function(cm, start) {
|
||||||
|
@ -91,14 +91,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) {
|
||||||
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
|
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
var start = start.line, has = hasInclude(start);
|
var startLine = start.line, has = hasInclude(startLine);
|
||||||
if (has == null || hasInclude(start - 1) != null) return null;
|
if (has == null || hasInclude(startLine - 1) != null) return null;
|
||||||
for (var end = start;;) {
|
for (var end = startLine;;) {
|
||||||
var next = hasInclude(end + 1);
|
var next = hasInclude(end + 1);
|
||||||
if (next == null) break;
|
if (next == null) break;
|
||||||
++end;
|
++end;
|
||||||
}
|
}
|
||||||
return {from: CodeMirror.Pos(start, has + 1),
|
return {from: CodeMirror.Pos(startLine, has + 1),
|
||||||
to: cm.clipPos(CodeMirror.Pos(end))};
|
to: cm.clipPos(CodeMirror.Pos(end))};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -140,9 +140,9 @@
|
||||||
var openTag = toNextTag(iter), end;
|
var openTag = toNextTag(iter), end;
|
||||||
if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
|
if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
|
||||||
if (!openTag[1] && end != "selfClose") {
|
if (!openTag[1] && end != "selfClose") {
|
||||||
var start = Pos(iter.line, iter.ch);
|
var startPos = Pos(iter.line, iter.ch);
|
||||||
var close = findMatchingClose(iter, openTag[2]);
|
var endPos = findMatchingClose(iter, openTag[2]);
|
||||||
return close && {from: start, to: close.from};
|
return endPos && {from: startPos, to: endPos.from};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
background: white;
|
background: white;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
|
max-width: 19em;
|
||||||
|
|
||||||
max-height: 20em;
|
max-height: 20em;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -25,8 +26,6 @@
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
max-width: 19em;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
color: black;
|
color: black;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
58
public/vendor/codemirror/addon/hint/show-hint.js
vendored
58
public/vendor/codemirror/addon/hint/show-hint.js
vendored
|
@ -108,15 +108,11 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function(first) {
|
update: function(first) {
|
||||||
if (this.tick == null) return;
|
if (this.tick == null) return
|
||||||
if (!this.options.hint.async) {
|
var self = this, myTick = ++this.tick
|
||||||
this.finishUpdate(this.options.hint(this.cm, this.options), first);
|
fetchHints(this.options.hint, this.cm, this.options, function(data) {
|
||||||
} else {
|
if (self.tick == myTick) self.finishUpdate(data, first)
|
||||||
var myTick = ++this.tick, self = this;
|
})
|
||||||
this.options.hint(this.cm, function(data) {
|
|
||||||
if (self.tick == myTick) self.finishUpdate(data, first);
|
|
||||||
}, this.options);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
finishUpdate: function(data, first) {
|
finishUpdate: function(data, first) {
|
||||||
|
@ -233,6 +229,7 @@
|
||||||
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
|
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
|
||||||
(completion.options.container || document.body).appendChild(hints);
|
(completion.options.container || document.body).appendChild(hints);
|
||||||
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
|
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
|
||||||
|
var scrolls = hints.scrollHeight > hints.clientHeight + 1
|
||||||
if (overlapY > 0) {
|
if (overlapY > 0) {
|
||||||
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
|
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
|
||||||
if (curTop - height > 0) { // Fits above cursor
|
if (curTop - height > 0) { // Fits above cursor
|
||||||
|
@ -257,6 +254,8 @@
|
||||||
}
|
}
|
||||||
hints.style.left = (left = pos.left - overlapX) + "px";
|
hints.style.left = (left = pos.left - overlapX) + "px";
|
||||||
}
|
}
|
||||||
|
if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)
|
||||||
|
node.style.paddingRight = cm.display.nativeBarWidth + "px"
|
||||||
|
|
||||||
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
|
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
|
||||||
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
|
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
|
||||||
|
@ -362,40 +361,31 @@
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fetchHints(hint, cm, options, callback) {
|
||||||
|
if (hint.async) {
|
||||||
|
hint(cm, callback, options)
|
||||||
|
} else {
|
||||||
|
var result = hint(cm, options)
|
||||||
|
if (result && result.then) result.then(callback)
|
||||||
|
else callback(result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function resolveAutoHints(cm, pos) {
|
function resolveAutoHints(cm, pos) {
|
||||||
var helpers = cm.getHelpers(pos, "hint"), words
|
var helpers = cm.getHelpers(pos, "hint"), words
|
||||||
if (helpers.length) {
|
if (helpers.length) {
|
||||||
var async = false, resolved
|
var resolved = function(cm, callback, options) {
|
||||||
for (var i = 0; i < helpers.length; i++) if (helpers[i].async) async = true
|
var app = applicableHelpers(cm, helpers);
|
||||||
if (async) {
|
function run(i) {
|
||||||
resolved = function(cm, callback, options) {
|
|
||||||
var app = applicableHelpers(cm, helpers)
|
|
||||||
function run(i, result) {
|
|
||||||
if (i == app.length) return callback(null)
|
if (i == app.length) return callback(null)
|
||||||
var helper = app[i]
|
fetchHints(app[i], cm, options, function(result) {
|
||||||
if (helper.async) {
|
if (result && result.list.length > 0) callback(result)
|
||||||
helper(cm, function(result) {
|
|
||||||
if (result) callback(result)
|
|
||||||
else run(i + 1)
|
else run(i + 1)
|
||||||
}, options)
|
})
|
||||||
} else {
|
|
||||||
var result = helper(cm, options)
|
|
||||||
if (result) callback(result)
|
|
||||||
else run(i + 1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
run(0)
|
run(0)
|
||||||
}
|
}
|
||||||
resolved.async = true
|
resolved.async = true
|
||||||
} else {
|
|
||||||
resolved = function(cm, options) {
|
|
||||||
var app = applicableHelpers(cm, helpers)
|
|
||||||
for (var i = 0; i < app.length; i++) {
|
|
||||||
var cur = app[i](cm, options)
|
|
||||||
if (cur && cur.list.length) return cur
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resolved.supportsSelection = true
|
resolved.supportsSelection = true
|
||||||
return resolved
|
return resolved
|
||||||
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
|
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
|
||||||
|
|
|
@ -241,7 +241,7 @@
|
||||||
var defaultTableName = options && options.defaultTable;
|
var defaultTableName = options && options.defaultTable;
|
||||||
var disableKeywords = options && options.disableKeywords;
|
var disableKeywords = options && options.disableKeywords;
|
||||||
defaultTable = defaultTableName && getTable(defaultTableName);
|
defaultTable = defaultTableName && getTable(defaultTableName);
|
||||||
keywords = keywords || getKeywords(editor);
|
keywords = getKeywords(editor);
|
||||||
|
|
||||||
if (defaultTableName && !defaultTable)
|
if (defaultTableName && !defaultTable)
|
||||||
defaultTable = findTableByAlias(defaultTableName, editor);
|
defaultTable = findTableByAlias(defaultTableName, editor);
|
||||||
|
|
4
public/vendor/codemirror/addon/lint/lint.css
vendored
4
public/vendor/codemirror/addon/lint/lint.css
vendored
|
@ -4,10 +4,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-lint-tooltip {
|
.CodeMirror-lint-tooltip {
|
||||||
background-color: infobackground;
|
background-color: #ffd;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
border-radius: 4px 4px 4px 4px;
|
border-radius: 4px 4px 4px 4px;
|
||||||
color: infotext;
|
color: black;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
3
public/vendor/codemirror/addon/lint/lint.js
vendored
3
public/vendor/codemirror/addon/lint/lint.js
vendored
|
@ -204,7 +204,8 @@
|
||||||
|
|
||||||
var annotations = [];
|
var annotations = [];
|
||||||
for (var i = 0; i < spans.length; ++i) {
|
for (var i = 0; i < spans.length; ++i) {
|
||||||
annotations.push(spans[i].__annotation);
|
var ann = spans[i].__annotation;
|
||||||
|
if (ann) annotations.push(ann);
|
||||||
}
|
}
|
||||||
if (annotations.length) popupTooltips(annotations, e);
|
if (annotations.length) popupTooltips(annotations, e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,10 +59,10 @@
|
||||||
CodeMirror.on(this.node, "DOMMouseScroll", onWheel);
|
CodeMirror.on(this.node, "DOMMouseScroll", onWheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bar.prototype.setPos = function(pos) {
|
Bar.prototype.setPos = function(pos, force) {
|
||||||
if (pos < 0) pos = 0;
|
if (pos < 0) pos = 0;
|
||||||
if (pos > this.total - this.screen) pos = this.total - this.screen;
|
if (pos > this.total - this.screen) pos = this.total - this.screen;
|
||||||
if (pos == this.pos) return false;
|
if (!force && pos == this.pos) return false;
|
||||||
this.pos = pos;
|
this.pos = pos;
|
||||||
this.inner.style[this.orientation == "horizontal" ? "left" : "top"] =
|
this.inner.style[this.orientation == "horizontal" ? "left" : "top"] =
|
||||||
(pos * (this.size / this.total)) + "px";
|
(pos * (this.size / this.total)) + "px";
|
||||||
|
@ -76,9 +76,12 @@
|
||||||
var minButtonSize = 10;
|
var minButtonSize = 10;
|
||||||
|
|
||||||
Bar.prototype.update = function(scrollSize, clientSize, barSize) {
|
Bar.prototype.update = function(scrollSize, clientSize, barSize) {
|
||||||
|
var sizeChanged = this.screen != clientSize || this.total != scrollSize || this.size != barSize
|
||||||
|
if (sizeChanged) {
|
||||||
this.screen = clientSize;
|
this.screen = clientSize;
|
||||||
this.total = scrollSize;
|
this.total = scrollSize;
|
||||||
this.size = barSize;
|
this.size = barSize;
|
||||||
|
}
|
||||||
|
|
||||||
var buttonSize = this.screen * (this.size / this.total);
|
var buttonSize = this.screen * (this.size / this.total);
|
||||||
if (buttonSize < minButtonSize) {
|
if (buttonSize < minButtonSize) {
|
||||||
|
@ -87,7 +90,7 @@
|
||||||
}
|
}
|
||||||
this.inner.style[this.orientation == "horizontal" ? "width" : "height"] =
|
this.inner.style[this.orientation == "horizontal" ? "width" : "height"] =
|
||||||
buttonSize + "px";
|
buttonSize + "px";
|
||||||
this.setPos(this.pos);
|
this.setPos(this.pos, sizeChanged);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SimpleScrollbars(cls, place, scroll) {
|
function SimpleScrollbars(cls, place, scroll) {
|
||||||
|
|
|
@ -29,24 +29,20 @@
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var DEFAULT_MIN_CHARS = 2;
|
var defaults = {
|
||||||
var DEFAULT_TOKEN_STYLE = "matchhighlight";
|
style: "matchhighlight",
|
||||||
var DEFAULT_DELAY = 100;
|
minChars: 2,
|
||||||
var DEFAULT_WORDS_ONLY = false;
|
delay: 100,
|
||||||
|
wordsOnly: false,
|
||||||
|
annotateScrollbar: false,
|
||||||
|
showToken: false,
|
||||||
|
trim: true
|
||||||
|
}
|
||||||
|
|
||||||
function State(options) {
|
function State(options) {
|
||||||
if (typeof options == "object") {
|
this.options = {}
|
||||||
this.minChars = options.minChars;
|
for (var name in defaults)
|
||||||
this.style = options.style;
|
this.options[name] = (options && options.hasOwnProperty(name) ? options : defaults)[name]
|
||||||
this.showToken = options.showToken;
|
|
||||||
this.delay = options.delay;
|
|
||||||
this.wordsOnly = options.wordsOnly;
|
|
||||||
this.annotateScrollbar = options.annotateScrollbar;
|
|
||||||
}
|
|
||||||
if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
|
|
||||||
if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
|
|
||||||
if (this.delay == null) this.delay = DEFAULT_DELAY;
|
|
||||||
if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY;
|
|
||||||
this.overlay = this.timeout = null;
|
this.overlay = this.timeout = null;
|
||||||
this.matchesonscroll = null;
|
this.matchesonscroll = null;
|
||||||
}
|
}
|
||||||
|
@ -68,13 +64,13 @@
|
||||||
function cursorActivity(cm) {
|
function cursorActivity(cm) {
|
||||||
var state = cm.state.matchHighlighter;
|
var state = cm.state.matchHighlighter;
|
||||||
clearTimeout(state.timeout);
|
clearTimeout(state.timeout);
|
||||||
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay);
|
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.options.delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addOverlay(cm, query, hasBoundary, style) {
|
function addOverlay(cm, query, hasBoundary, style) {
|
||||||
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.annotateScrollbar) {
|
if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
|
||||||
var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
|
var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
|
||||||
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, true,
|
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, true,
|
||||||
{className: "CodeMirror-selection-highlight-scrollbar"});
|
{className: "CodeMirror-selection-highlight-scrollbar"});
|
||||||
|
@ -86,7 +82,7 @@
|
||||||
if (state.overlay) {
|
if (state.overlay) {
|
||||||
cm.removeOverlay(state.overlay);
|
cm.removeOverlay(state.overlay);
|
||||||
state.overlay = null;
|
state.overlay = null;
|
||||||
if (state.annotateScrollbar) {
|
if (state.matchesonscroll) {
|
||||||
state.matchesonscroll.clear();
|
state.matchesonscroll.clear();
|
||||||
state.matchesonscroll = null;
|
state.matchesonscroll = null;
|
||||||
}
|
}
|
||||||
|
@ -97,21 +93,22 @@
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
var state = cm.state.matchHighlighter;
|
var state = cm.state.matchHighlighter;
|
||||||
removeOverlay(cm);
|
removeOverlay(cm);
|
||||||
if (!cm.somethingSelected() && state.showToken) {
|
if (!cm.somethingSelected() && state.options.showToken) {
|
||||||
var re = state.showToken === true ? /[\w$]/ : state.showToken;
|
var re = state.options.showToken === true ? /[\w$]/ : state.options.showToken;
|
||||||
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
|
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
|
||||||
while (start && re.test(line.charAt(start - 1))) --start;
|
while (start && re.test(line.charAt(start - 1))) --start;
|
||||||
while (end < line.length && re.test(line.charAt(end))) ++end;
|
while (end < line.length && re.test(line.charAt(end))) ++end;
|
||||||
if (start < end)
|
if (start < end)
|
||||||
addOverlay(cm, line.slice(start, end), re, state.style);
|
addOverlay(cm, line.slice(start, end), re, state.options.style);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
var from = cm.getCursor("from"), to = cm.getCursor("to");
|
||||||
if (from.line != to.line) return;
|
if (from.line != to.line) return;
|
||||||
if (state.wordsOnly && !isWord(cm, from, to)) return;
|
if (state.options.wordsOnly && !isWord(cm, from, to)) return;
|
||||||
var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, "");
|
var selection = cm.getRange(from, to)
|
||||||
if (selection.length >= state.minChars)
|
if (state.options.trim) selection = selection.replace(/^\s+|\s+$/g, "")
|
||||||
addOverlay(cm, selection, false, state.style);
|
if (selection.length >= state.options.minChars)
|
||||||
|
addOverlay(cm, selection, false, state.options.style);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
34
public/vendor/codemirror/codemirror.min.js
vendored
34
public/vendor/codemirror/codemirror.min.js
vendored
File diff suppressed because one or more lines are too long
22
public/vendor/codemirror/keymap/sublime.js
vendored
22
public/vendor/codemirror/keymap/sublime.js
vendored
|
@ -124,6 +124,7 @@
|
||||||
}
|
}
|
||||||
cm.setSelections(newSelection);
|
cm.setSelections(newSelection);
|
||||||
});
|
});
|
||||||
|
cm.execCommand("indentAuto");
|
||||||
}
|
}
|
||||||
|
|
||||||
cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); };
|
cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); };
|
||||||
|
@ -419,27 +420,6 @@
|
||||||
|
|
||||||
map[cK + ctrl + "Backspace"] = "delLineLeft";
|
map[cK + ctrl + "Backspace"] = "delLineLeft";
|
||||||
|
|
||||||
cmds[map["Backspace"] = "smartBackspace"] = function(cm) {
|
|
||||||
if (cm.somethingSelected()) return CodeMirror.Pass;
|
|
||||||
|
|
||||||
var cursor = cm.getCursor();
|
|
||||||
var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor);
|
|
||||||
var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize"));
|
|
||||||
var indentUnit = cm.getOption("indentUnit");
|
|
||||||
|
|
||||||
if (toStartOfLine && !/\S/.test(toStartOfLine) && column % indentUnit == 0) {
|
|
||||||
var prevIndent = new Pos(cursor.line,
|
|
||||||
CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit));
|
|
||||||
|
|
||||||
// If no smart delete is happening (due to tab sizing) just do a regular delete
|
|
||||||
if (prevIndent.ch == cursor.ch) return CodeMirror.Pass;
|
|
||||||
|
|
||||||
return cm.replaceRange("", prevIndent, cursor, "+delete");
|
|
||||||
} else {
|
|
||||||
return CodeMirror.Pass;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) {
|
cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
|
|
15
public/vendor/codemirror/keymap/vim.js
vendored
15
public/vendor/codemirror/keymap/vim.js
vendored
|
@ -3782,17 +3782,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function makePrompt(prefix, desc) {
|
function makePrompt(prefix, desc) {
|
||||||
var raw = '';
|
var raw = '<span style="font-family: monospace; white-space: pre">' +
|
||||||
if (prefix) {
|
(prefix || "") + '<input type="text"></span>';
|
||||||
raw += '<span style="font-family: monospace">' + prefix + '</span>';
|
if (desc)
|
||||||
}
|
raw += ' <span style="color: #888">' + desc + '</span>';
|
||||||
raw += '<input type="text"/> ' +
|
|
||||||
'<span style="color: #888">';
|
|
||||||
if (desc) {
|
|
||||||
raw += '<span style="color: #888">';
|
|
||||||
raw += desc;
|
|
||||||
raw += '</span>';
|
|
||||||
}
|
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
var searchPromptDesc = '(Javascript regexp)';
|
var searchPromptDesc = '(Javascript regexp)';
|
||||||
|
|
2
public/vendor/codemirror/lib/codemirror.css
vendored
2
public/vendor/codemirror/lib/codemirror.css
vendored
|
@ -52,7 +52,7 @@
|
||||||
}
|
}
|
||||||
.cm-fat-cursor .CodeMirror-cursor {
|
.cm-fat-cursor .CodeMirror-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0 !important;
|
||||||
background: #7e7;
|
background: #7e7;
|
||||||
}
|
}
|
||||||
.cm-fat-cursor div.CodeMirror-cursors {
|
.cm-fat-cursor div.CodeMirror-cursors {
|
||||||
|
|
83
public/vendor/codemirror/lib/codemirror.js
vendored
83
public/vendor/codemirror/lib/codemirror.js
vendored
|
@ -1096,9 +1096,9 @@
|
||||||
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
|
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will be set to an array of strings when copying, so that,
|
// This will be set to a {lineWise: bool, text: [string]} object, so
|
||||||
// when pasting, we know what kind of selections the copied text
|
// that, when pasting, we know what kind of selections the copied
|
||||||
// was made out of.
|
// text was made out of.
|
||||||
var lastCopied = null;
|
var lastCopied = null;
|
||||||
|
|
||||||
function applyTextInput(cm, inserted, deleted, sel, origin) {
|
function applyTextInput(cm, inserted, deleted, sel, origin) {
|
||||||
|
@ -1107,14 +1107,14 @@
|
||||||
if (!sel) sel = doc.sel;
|
if (!sel) sel = doc.sel;
|
||||||
|
|
||||||
var paste = cm.state.pasteIncoming || origin == "paste";
|
var paste = cm.state.pasteIncoming || origin == "paste";
|
||||||
var textLines = doc.splitLines(inserted), multiPaste = null;
|
var textLines = doc.splitLines(inserted), multiPaste = null
|
||||||
// When pasing N lines into N selections, insert one line per selection
|
// When pasing 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.join("\n") == inserted) {
|
if (lastCopied && lastCopied.text.join("\n") == inserted) {
|
||||||
if (sel.ranges.length % lastCopied.length == 0) {
|
if (sel.ranges.length % lastCopied.text.length == 0) {
|
||||||
multiPaste = [];
|
multiPaste = [];
|
||||||
for (var i = 0; i < lastCopied.length; i++)
|
for (var i = 0; i < lastCopied.text.length; i++)
|
||||||
multiPaste.push(doc.splitLines(lastCopied[i]));
|
multiPaste.push(doc.splitLines(lastCopied.text[i]));
|
||||||
}
|
}
|
||||||
} else if (textLines.length == sel.ranges.length) {
|
} else if (textLines.length == sel.ranges.length) {
|
||||||
multiPaste = map(textLines, function(l) { return [l]; });
|
multiPaste = map(textLines, function(l) { return [l]; });
|
||||||
|
@ -1130,6 +1130,8 @@
|
||||||
from = Pos(from.line, from.ch - deleted);
|
from = Pos(from.line, from.ch - deleted);
|
||||||
else if (cm.state.overwrite && !paste) // Handle overwrite
|
else if (cm.state.overwrite && !paste) // Handle overwrite
|
||||||
to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));
|
to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));
|
||||||
|
else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
|
||||||
|
from = to = Pos(from.line, 0)
|
||||||
}
|
}
|
||||||
var updateInput = cm.curOp.updateInput;
|
var updateInput = cm.curOp.updateInput;
|
||||||
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,
|
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,
|
||||||
|
@ -1262,18 +1264,18 @@
|
||||||
function prepareCopyCut(e) {
|
function prepareCopyCut(e) {
|
||||||
if (signalDOMEvent(cm, e)) return
|
if (signalDOMEvent(cm, e)) return
|
||||||
if (cm.somethingSelected()) {
|
if (cm.somethingSelected()) {
|
||||||
lastCopied = cm.getSelections();
|
lastCopied = {lineWise: false, text: cm.getSelections()};
|
||||||
if (input.inaccurateSelection) {
|
if (input.inaccurateSelection) {
|
||||||
input.prevInput = "";
|
input.prevInput = "";
|
||||||
input.inaccurateSelection = false;
|
input.inaccurateSelection = false;
|
||||||
te.value = lastCopied.join("\n");
|
te.value = lastCopied.text.join("\n");
|
||||||
selectInput(te);
|
selectInput(te);
|
||||||
}
|
}
|
||||||
} else if (!cm.options.lineWiseCopyCut) {
|
} else if (!cm.options.lineWiseCopyCut) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
var ranges = copyableRanges(cm);
|
var ranges = copyableRanges(cm);
|
||||||
lastCopied = ranges.text;
|
lastCopied = {lineWise: true, text: ranges.text};
|
||||||
if (e.type == "cut") {
|
if (e.type == "cut") {
|
||||||
cm.setSelections(ranges.ranges, null, sel_dontScroll);
|
cm.setSelections(ranges.ranges, null, sel_dontScroll);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1623,13 +1625,13 @@
|
||||||
function onCopyCut(e) {
|
function onCopyCut(e) {
|
||||||
if (signalDOMEvent(cm, e)) return
|
if (signalDOMEvent(cm, e)) return
|
||||||
if (cm.somethingSelected()) {
|
if (cm.somethingSelected()) {
|
||||||
lastCopied = cm.getSelections();
|
lastCopied = {lineWise: false, text: cm.getSelections()};
|
||||||
if (e.type == "cut") cm.replaceSelection("", null, "cut");
|
if (e.type == "cut") cm.replaceSelection("", null, "cut");
|
||||||
} else if (!cm.options.lineWiseCopyCut) {
|
} else if (!cm.options.lineWiseCopyCut) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
var ranges = copyableRanges(cm);
|
var ranges = copyableRanges(cm);
|
||||||
lastCopied = ranges.text;
|
lastCopied = {lineWise: true, text: ranges.text};
|
||||||
if (e.type == "cut") {
|
if (e.type == "cut") {
|
||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
cm.setSelections(ranges.ranges, 0, sel_dontScroll);
|
cm.setSelections(ranges.ranges, 0, sel_dontScroll);
|
||||||
|
@ -1641,12 +1643,12 @@
|
||||||
if (e.clipboardData && !ios) {
|
if (e.clipboardData && !ios) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.clipboardData.clearData();
|
e.clipboardData.clearData();
|
||||||
e.clipboardData.setData("text/plain", lastCopied.join("\n"));
|
e.clipboardData.setData("text/plain", lastCopied.text.join("\n"));
|
||||||
} else {
|
} else {
|
||||||
// Old-fashioned briefly-focus-a-textarea hack
|
// Old-fashioned briefly-focus-a-textarea hack
|
||||||
var kludge = hiddenTextarea(), te = kludge.firstChild;
|
var kludge = hiddenTextarea(), te = kludge.firstChild;
|
||||||
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
|
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
|
||||||
te.value = lastCopied.join("\n");
|
te.value = lastCopied.text.join("\n");
|
||||||
var hadFocus = document.activeElement;
|
var hadFocus = document.activeElement;
|
||||||
selectInput(te);
|
selectInput(te);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
@ -1665,9 +1667,9 @@
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
showSelection: function(info) {
|
showSelection: function(info, takeFocus) {
|
||||||
if (!info || !this.cm.display.view.length) return;
|
if (!info || !this.cm.display.view.length) return;
|
||||||
if (info.focus) this.showPrimarySelection();
|
if (info.focus || takeFocus) this.showPrimarySelection();
|
||||||
this.showMultipleSelections(info);
|
this.showMultipleSelections(info);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -3113,7 +3115,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op.updatedDisplay || op.selectionChanged)
|
if (op.updatedDisplay || op.selectionChanged)
|
||||||
op.preparedSelection = display.input.prepareSelection();
|
op.preparedSelection = display.input.prepareSelection(op.focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
function endOperation_W2(op) {
|
function endOperation_W2(op) {
|
||||||
|
@ -3126,8 +3128,9 @@
|
||||||
cm.display.maxLineChanged = false;
|
cm.display.maxLineChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())
|
||||||
if (op.preparedSelection)
|
if (op.preparedSelection)
|
||||||
cm.display.input.showSelection(op.preparedSelection);
|
cm.display.input.showSelection(op.preparedSelection, takeFocus);
|
||||||
if (op.updatedDisplay || op.startHeight != cm.doc.height)
|
if (op.updatedDisplay || op.startHeight != cm.doc.height)
|
||||||
updateScrollbars(cm, op.barMeasure);
|
updateScrollbars(cm, op.barMeasure);
|
||||||
if (op.updatedDisplay)
|
if (op.updatedDisplay)
|
||||||
|
@ -3137,8 +3140,7 @@
|
||||||
|
|
||||||
if (cm.state.focused && op.updateInput)
|
if (cm.state.focused && op.updateInput)
|
||||||
cm.display.input.reset(op.typing);
|
cm.display.input.reset(op.typing);
|
||||||
if (op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()))
|
if (takeFocus) ensureFocus(op.cm);
|
||||||
ensureFocus(op.cm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function endOperation_finish(op) {
|
function endOperation_finish(op) {
|
||||||
|
@ -3918,6 +3920,7 @@
|
||||||
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
|
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
|
||||||
|
|
||||||
e.dataTransfer.setData("Text", cm.getSelection());
|
e.dataTransfer.setData("Text", cm.getSelection());
|
||||||
|
e.dataTransfer.effectAllowed = "copyMove"
|
||||||
|
|
||||||
// Use dummy image instead of default browsers image.
|
// Use dummy image instead of default browsers image.
|
||||||
// Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
|
// Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
|
||||||
|
@ -5403,7 +5406,7 @@
|
||||||
for (var i = newBreaks.length - 1; i >= 0; i--)
|
for (var i = newBreaks.length - 1; i >= 0; i--)
|
||||||
replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length))
|
replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length))
|
||||||
});
|
});
|
||||||
option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) {
|
option("specialChars", /[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) {
|
||||||
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
|
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
|
||||||
if (old != CodeMirror.Init) cm.refresh();
|
if (old != CodeMirror.Init) cm.refresh();
|
||||||
});
|
});
|
||||||
|
@ -5732,7 +5735,7 @@
|
||||||
for (var i = 0; i < ranges.length; i++) {
|
for (var i = 0; i < ranges.length; i++) {
|
||||||
var pos = ranges[i].from();
|
var pos = ranges[i].from();
|
||||||
var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);
|
var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);
|
||||||
spaces.push(new Array(tabSize - col % tabSize + 1).join(" "));
|
spaces.push(spaceStr(tabSize - col % tabSize));
|
||||||
}
|
}
|
||||||
cm.replaceSelections(spaces);
|
cm.replaceSelections(spaces);
|
||||||
},
|
},
|
||||||
|
@ -5775,6 +5778,7 @@
|
||||||
ensureCursorVisible(cm);
|
ensureCursorVisible(cm);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
openLine: function(cm) {cm.replaceSelection("\n", "start")},
|
||||||
toggleOverwrite: function(cm) {cm.toggleOverwrite();}
|
toggleOverwrite: function(cm) {cm.toggleOverwrite();}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5809,7 +5813,8 @@
|
||||||
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
|
"Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
|
||||||
"Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
|
"Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
|
||||||
"Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
|
"Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
|
||||||
"Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars"
|
"Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
|
||||||
|
"Ctrl-O": "openLine"
|
||||||
};
|
};
|
||||||
keyMap.macDefault = {
|
keyMap.macDefault = {
|
||||||
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
|
"Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
|
||||||
|
@ -6571,8 +6576,8 @@
|
||||||
var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);
|
var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);
|
||||||
var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);
|
var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);
|
||||||
if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;
|
if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;
|
||||||
if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||
|
if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
|
||||||
fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))
|
fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6974,8 +6979,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// See issue #2901
|
// See issue #2901
|
||||||
if (webkit && /\bcm-tab\b/.test(builder.content.lastChild.className))
|
if (webkit) {
|
||||||
|
var last = builder.content.lastChild
|
||||||
|
if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
|
||||||
builder.content.className = "cm-tab-wrap-hack";
|
builder.content.className = "cm-tab-wrap-hack";
|
||||||
|
}
|
||||||
|
|
||||||
signal(cm, "renderLine", cm, lineView.line, builder.pre);
|
signal(cm, "renderLine", cm, lineView.line, builder.pre);
|
||||||
if (builder.pre.className)
|
if (builder.pre.className)
|
||||||
|
@ -7327,13 +7335,16 @@
|
||||||
if (at <= sz) {
|
if (at <= sz) {
|
||||||
child.insertInner(at, lines, height);
|
child.insertInner(at, lines, height);
|
||||||
if (child.lines && child.lines.length > 50) {
|
if (child.lines && child.lines.length > 50) {
|
||||||
while (child.lines.length > 50) {
|
// To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
|
||||||
var spilled = child.lines.splice(child.lines.length - 25, 25);
|
// Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
|
||||||
var newleaf = new LeafChunk(spilled);
|
var remaining = child.lines.length % 25 + 25
|
||||||
child.height -= newleaf.height;
|
for (var pos = remaining; pos < child.lines.length;) {
|
||||||
this.children.splice(i + 1, 0, newleaf);
|
var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));
|
||||||
newleaf.parent = this;
|
child.height -= leaf.height;
|
||||||
|
this.children.splice(++i, 0, leaf);
|
||||||
|
leaf.parent = this;
|
||||||
}
|
}
|
||||||
|
child.lines = child.lines.slice(0, remaining);
|
||||||
this.maybeSpill();
|
this.maybeSpill();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -7638,9 +7649,9 @@
|
||||||
var spans = line.markedSpans;
|
var spans = line.markedSpans;
|
||||||
if (spans) for (var i = 0; i < spans.length; i++) {
|
if (spans) for (var i = 0; i < spans.length; i++) {
|
||||||
var span = spans[i];
|
var span = spans[i];
|
||||||
if (!(span.to != null && lineNo == from.line && from.ch > span.to ||
|
if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||
|
||||||
span.from == null && lineNo != from.line ||
|
span.from == null && lineNo != from.line ||
|
||||||
span.from != null && lineNo == to.line && span.from > to.ch) &&
|
span.from != null && lineNo == to.line && span.from >= to.ch) &&
|
||||||
(!filter || filter(span.marker)))
|
(!filter || filter(span.marker)))
|
||||||
found.push(span.marker.parent || span.marker);
|
found.push(span.marker.parent || span.marker);
|
||||||
}
|
}
|
||||||
|
@ -8904,7 +8915,7 @@
|
||||||
|
|
||||||
// THE END
|
// THE END
|
||||||
|
|
||||||
CodeMirror.version = "5.13.5";
|
CodeMirror.version = "5.15.3";
|
||||||
|
|
||||||
return CodeMirror;
|
return CodeMirror;
|
||||||
});
|
});
|
||||||
|
|
61
public/vendor/codemirror/mode/clike/clike.js
vendored
61
public/vendor/codemirror/mode/clike/clike.js
vendored
|
@ -11,21 +11,19 @@
|
||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function Context(indented, column, type, align, prev) {
|
function Context(indented, column, type, info, align, prev) {
|
||||||
this.indented = indented;
|
this.indented = indented;
|
||||||
this.column = column;
|
this.column = column;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
this.info = info;
|
||||||
this.align = align;
|
this.align = align;
|
||||||
this.prev = prev;
|
this.prev = prev;
|
||||||
}
|
}
|
||||||
function isStatement(type) {
|
function pushContext(state, col, type, info) {
|
||||||
return type == "statement" || type == "switchstatement" || type == "namespace";
|
|
||||||
}
|
|
||||||
function pushContext(state, col, type) {
|
|
||||||
var indent = state.indented;
|
var indent = state.indented;
|
||||||
if (state.context && isStatement(state.context.type) && !isStatement(type))
|
if (state.context && state.context.type != "statement" && type != "statement")
|
||||||
indent = state.context.indented;
|
indent = state.context.indented;
|
||||||
return state.context = new Context(indent, col, type, null, state.context);
|
return state.context = new Context(indent, col, type, info, null, state.context);
|
||||||
}
|
}
|
||||||
function popContext(state) {
|
function popContext(state) {
|
||||||
var t = state.context.type;
|
var t = state.context.type;
|
||||||
|
@ -34,15 +32,16 @@ function popContext(state) {
|
||||||
return state.context = state.context.prev;
|
return state.context = state.context.prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
function typeBefore(stream, state) {
|
function typeBefore(stream, state, pos) {
|
||||||
if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
|
if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
|
||||||
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
|
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
|
||||||
|
if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isTopScope(context) {
|
function isTopScope(context) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!context || context.type == "top") return true;
|
if (!context || context.type == "top") return true;
|
||||||
if (context.type == "}" && context.prev.type != "namespace") return false;
|
if (context.type == "}" && context.prev.info != "namespace") return false;
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,13 +146,18 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||||
return "comment";
|
return "comment";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function maybeEOL(stream, state) {
|
||||||
|
if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))
|
||||||
|
state.typeAtEndOfLine = typeBefore(stream, state, stream.pos)
|
||||||
|
}
|
||||||
|
|
||||||
// Interface
|
// Interface
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startState: function(basecolumn) {
|
startState: function(basecolumn) {
|
||||||
return {
|
return {
|
||||||
tokenize: null,
|
tokenize: null,
|
||||||
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
|
||||||
indented: 0,
|
indented: 0,
|
||||||
startOfLine: true,
|
startOfLine: true,
|
||||||
prevToken: null
|
prevToken: null
|
||||||
|
@ -167,36 +171,31 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||||
state.indented = stream.indentation();
|
state.indented = stream.indentation();
|
||||||
state.startOfLine = true;
|
state.startOfLine = true;
|
||||||
}
|
}
|
||||||
if (stream.eatSpace()) return null;
|
if (stream.eatSpace()) { maybeEOL(stream, state); return null; }
|
||||||
curPunc = isDefKeyword = null;
|
curPunc = isDefKeyword = null;
|
||||||
var style = (state.tokenize || tokenBase)(stream, state);
|
var style = (state.tokenize || tokenBase)(stream, state);
|
||||||
if (style == "comment" || style == "meta") return style;
|
if (style == "comment" || style == "meta") return style;
|
||||||
if (ctx.align == null) ctx.align = true;
|
if (ctx.align == null) ctx.align = true;
|
||||||
|
|
||||||
if (endStatement.test(curPunc)) while (isStatement(state.context.type)) popContext(state);
|
if (endStatement.test(curPunc)) while (state.context.type == "statement") popContext(state);
|
||||||
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
||||||
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
||||||
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
||||||
else if (curPunc == "}") {
|
else if (curPunc == "}") {
|
||||||
while (isStatement(ctx.type)) ctx = popContext(state);
|
while (ctx.type == "statement") ctx = popContext(state);
|
||||||
if (ctx.type == "}") ctx = popContext(state);
|
if (ctx.type == "}") ctx = popContext(state);
|
||||||
while (isStatement(ctx.type)) ctx = popContext(state);
|
while (ctx.type == "statement") ctx = popContext(state);
|
||||||
}
|
}
|
||||||
else if (curPunc == ctx.type) popContext(state);
|
else if (curPunc == ctx.type) popContext(state);
|
||||||
else if (indentStatements &&
|
else if (indentStatements &&
|
||||||
(((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
|
(((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
|
||||||
(isStatement(ctx.type) && curPunc == "newstatement"))) {
|
(ctx.type == "statement" && curPunc == "newstatement"))) {
|
||||||
var type = "statement";
|
pushContext(state, stream.column(), "statement", stream.current());
|
||||||
if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch")
|
|
||||||
type = "switchstatement";
|
|
||||||
else if (style == "keyword" && stream.current() == "namespace")
|
|
||||||
type = "namespace";
|
|
||||||
pushContext(state, stream.column(), type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (style == "variable" &&
|
if (style == "variable" &&
|
||||||
((state.prevToken == "def" ||
|
((state.prevToken == "def" ||
|
||||||
(parserConfig.typeFirstDefinitions && typeBefore(stream, state) &&
|
(parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) &&
|
||||||
isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
|
isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
|
||||||
style = "def";
|
style = "def";
|
||||||
|
|
||||||
|
@ -209,24 +208,28 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||||
|
|
||||||
state.startOfLine = false;
|
state.startOfLine = false;
|
||||||
state.prevToken = isDefKeyword ? "def" : style || curPunc;
|
state.prevToken = isDefKeyword ? "def" : style || curPunc;
|
||||||
|
maybeEOL(stream, state);
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
|
|
||||||
indent: function(state, textAfter) {
|
indent: function(state, textAfter) {
|
||||||
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
|
||||||
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
||||||
if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
|
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
||||||
|
if (parserConfig.dontIndentStatements)
|
||||||
|
while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info))
|
||||||
|
ctx = ctx.prev
|
||||||
if (hooks.indent) {
|
if (hooks.indent) {
|
||||||
var hook = hooks.indent(state, ctx, textAfter);
|
var hook = hooks.indent(state, ctx, textAfter);
|
||||||
if (typeof hook == "number") return hook
|
if (typeof hook == "number") return hook
|
||||||
}
|
}
|
||||||
var closing = firstChar == ctx.type;
|
var closing = firstChar == ctx.type;
|
||||||
var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
|
var switchBlock = ctx.prev && ctx.prev.info == "switch";
|
||||||
if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
|
if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
|
||||||
while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
|
while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
|
||||||
return ctx.indented
|
return ctx.indented
|
||||||
}
|
}
|
||||||
if (isStatement(ctx.type))
|
if (ctx.type == "statement")
|
||||||
return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
||||||
if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
|
if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
|
||||||
return ctx.column + (closing ? 0 : 1);
|
return ctx.column + (closing ? 0 : 1);
|
||||||
|
@ -386,6 +389,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||||
defKeywords: words("class namespace struct enum union"),
|
defKeywords: words("class namespace struct enum union"),
|
||||||
typeFirstDefinitions: true,
|
typeFirstDefinitions: true,
|
||||||
atoms: words("true false null"),
|
atoms: words("true false null"),
|
||||||
|
dontIndentStatements: /^template$/,
|
||||||
hooks: {
|
hooks: {
|
||||||
"#": cppHook,
|
"#": cppHook,
|
||||||
"*": pointerHook,
|
"*": pointerHook,
|
||||||
|
@ -429,6 +433,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||||
typeFirstDefinitions: true,
|
typeFirstDefinitions: true,
|
||||||
atoms: words("true false null"),
|
atoms: words("true false null"),
|
||||||
endStatement: /^[;:]$/,
|
endStatement: /^[;:]$/,
|
||||||
|
number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
|
||||||
hooks: {
|
hooks: {
|
||||||
"@": function(stream) {
|
"@": function(stream) {
|
||||||
stream.eatWhile(/[\w\$_]/);
|
stream.eatWhile(/[\w\$_]/);
|
||||||
|
@ -531,7 +536,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||||
"=": function(stream, state) {
|
"=": function(stream, state) {
|
||||||
var cx = state.context
|
var cx = state.context
|
||||||
if (cx.type == "}" && cx.align && stream.eat(">")) {
|
if (cx.type == "}" && cx.align && stream.eat(">")) {
|
||||||
state.context = new Context(cx.indented, cx.column, cx.type, null, cx.prev)
|
state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev)
|
||||||
return "operator"
|
return "operator"
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
|
|
4
public/vendor/codemirror/mode/clike/test.js
vendored
4
public/vendor/codemirror/mode/clike/test.js
vendored
|
@ -25,6 +25,10 @@
|
||||||
"[keyword struct] [def bar]{}",
|
"[keyword struct] [def bar]{}",
|
||||||
"[variable-3 int] [variable-3 *][def baz]() {}");
|
"[variable-3 int] [variable-3 *][def baz]() {}");
|
||||||
|
|
||||||
|
MT("def_new_line",
|
||||||
|
"::[variable std]::[variable SomeTerribleType][operator <][variable T][operator >]",
|
||||||
|
"[def SomeLongMethodNameThatDoesntFitIntoOneLine]([keyword const] [variable MyType][operator &] [variable param]) {}")
|
||||||
|
|
||||||
MT("double_block",
|
MT("double_block",
|
||||||
"[keyword for] (;;)",
|
"[keyword for] (;;)",
|
||||||
" [keyword for] (;;)",
|
" [keyword for] (;;)",
|
||||||
|
|
62
public/vendor/codemirror/mode/clojure/clojure.js
vendored
62
public/vendor/codemirror/mode/clojure/clojure.js
vendored
File diff suppressed because one or more lines are too long
12
public/vendor/codemirror/mode/css/css.js
vendored
12
public/vendor/codemirror/mode/css/css.js
vendored
|
@ -484,9 +484,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||||
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
||||||
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
||||||
"font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
|
"font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
|
||||||
"grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end",
|
"grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap",
|
||||||
"grid-column-start", "grid-row", "grid-row-end", "grid-row-start",
|
"grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap",
|
||||||
"grid-template", "grid-template-areas", "grid-template-columns",
|
"grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
|
||||||
"grid-template-rows", "hanging-punctuation", "height", "hyphens",
|
"grid-template-rows", "hanging-punctuation", "height", "hyphens",
|
||||||
"icon", "image-orientation", "image-rendering", "image-resolution",
|
"icon", "image-orientation", "image-rendering", "image-resolution",
|
||||||
"inline-box-align", "justify-content", "left", "letter-spacing",
|
"inline-box-align", "justify-content", "left", "letter-spacing",
|
||||||
|
@ -601,7 +601,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||||
"compact", "condensed", "contain", "content",
|
"compact", "condensed", "contain", "content",
|
||||||
"content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
|
"content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
|
||||||
"cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
|
"cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
|
||||||
"decimal-leading-zero", "default", "default-button", "destination-atop",
|
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
|
||||||
"destination-in", "destination-out", "destination-over", "devanagari", "difference",
|
"destination-in", "destination-out", "destination-over", "devanagari", "difference",
|
||||||
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
|
"disc", "discard", "disclosure-closed", "disclosure-open", "document",
|
||||||
"dot-dash", "dot-dot-dash",
|
"dot-dash", "dot-dot-dash",
|
||||||
|
@ -615,13 +615,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||||
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
|
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
|
||||||
"ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
|
"ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
|
||||||
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
|
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
|
||||||
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
|
"forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
|
||||||
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
|
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
|
||||||
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
||||||
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
|
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
|
||||||
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
||||||
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
||||||
"inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert",
|
"inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
|
||||||
"italic", "japanese-formal", "japanese-informal", "justify", "kannada",
|
"italic", "japanese-formal", "japanese-informal", "justify", "kannada",
|
||||||
"katakana", "katakana-iroha", "keep-all", "khmer",
|
"katakana", "katakana-iroha", "keep-all", "khmer",
|
||||||
"korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
|
"korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
|
||||||
|
|
2
public/vendor/codemirror/mode/ebnf/ebnf.js
vendored
2
public/vendor/codemirror/mode/ebnf/ebnf.js
vendored
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
if (bracesMode !== null && (state.braced || peek === "{")) {
|
if (bracesMode !== null && (state.braced || peek === "{")) {
|
||||||
if (state.localState === null)
|
if (state.localState === null)
|
||||||
state.localState = bracesMode.startState();
|
state.localState = CodeMirror.startState(bracesMode);
|
||||||
|
|
||||||
var token = bracesMode.token(stream, state.localState),
|
var token = bracesMode.token(stream, state.localState),
|
||||||
text = stream.current();
|
text = stream.current();
|
||||||
|
|
|
@ -77,5 +77,5 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p><strong>MIME types defined:</strong> <code>text/x-Fortran</code>.</p>
|
<p><strong>MIME types defined:</strong> <code>text/x-fortran</code>.</p>
|
||||||
</article>
|
</article>
|
||||||
|
|
4
public/vendor/codemirror/mode/haml/haml.js
vendored
4
public/vendor/codemirror/mode/haml/haml.js
vendored
|
@ -98,8 +98,8 @@
|
||||||
return {
|
return {
|
||||||
// default to html mode
|
// default to html mode
|
||||||
startState: function() {
|
startState: function() {
|
||||||
var htmlState = htmlMode.startState();
|
var htmlState = CodeMirror.startState(htmlMode);
|
||||||
var rubyState = rubyMode.startState();
|
var rubyState = CodeMirror.startState(rubyMode);
|
||||||
return {
|
return {
|
||||||
htmlState: htmlState,
|
htmlState: htmlState,
|
||||||
rubyState: rubyState,
|
rubyState: rubyState,
|
||||||
|
|
|
@ -51,9 +51,10 @@ This is an example of EJS (embedded javascript)
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p>Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
|
<p>Mode for html embedded scripts like JSP and ASP.NET. Depends on multiplex and HtmlMixed which in turn depends on
|
||||||
JavaScript, CSS and XML.<br />Other dependencies include those of the scripting language chosen.</p>
|
JavaScript, CSS and XML.<br />Other dependencies include those of the scripting language chosen.</p>
|
||||||
|
|
||||||
<p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET),
|
<p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET),
|
||||||
<code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)</p>
|
<code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)
|
||||||
|
and <code>application/x-erb</code></p>
|
||||||
</article>
|
</article>
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startState: function () {
|
startState: function () {
|
||||||
var state = htmlMode.startState();
|
var state = CodeMirror.startState(htmlMode);
|
||||||
return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
|
return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
1
public/vendor/codemirror/mode/index.html
vendored
1
public/vendor/codemirror/mode/index.html
vendored
|
@ -86,6 +86,7 @@ option.</p>
|
||||||
<li><a href="lua/index.html">Lua</a></li>
|
<li><a href="lua/index.html">Lua</a></li>
|
||||||
<li><a href="markdown/index.html">Markdown</a> (<a href="gfm/index.html">GitHub-flavour</a>)</li>
|
<li><a href="markdown/index.html">Markdown</a> (<a href="gfm/index.html">GitHub-flavour</a>)</li>
|
||||||
<li><a href="mathematica/index.html">Mathematica</a></li>
|
<li><a href="mathematica/index.html">Mathematica</a></li>
|
||||||
|
<li><a href="mbox/index.html">mbox</a></li>
|
||||||
<li><a href="mirc/index.html">mIRC</a></li>
|
<li><a href="mirc/index.html">mIRC</a></li>
|
||||||
<li><a href="modelica/index.html">Modelica</a></li>
|
<li><a href="modelica/index.html">Modelica</a></li>
|
||||||
<li><a href="mscgen/index.html">MscGen</a></li>
|
<li><a href="mscgen/index.html">MscGen</a></li>
|
||||||
|
|
6
public/vendor/codemirror/mode/jade/jade.js
vendored
6
public/vendor/codemirror/mode/jade/jade.js
vendored
|
@ -36,7 +36,7 @@ CodeMirror.defineMode('jade', function (config) {
|
||||||
this.isInterpolating = false;
|
this.isInterpolating = false;
|
||||||
this.interpolationNesting = 0;
|
this.interpolationNesting = 0;
|
||||||
|
|
||||||
this.jsState = jsMode.startState();
|
this.jsState = CodeMirror.startState(jsMode);
|
||||||
|
|
||||||
this.restOfLine = '';
|
this.restOfLine = '';
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ CodeMirror.defineMode('jade', function (config) {
|
||||||
if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) {
|
if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) {
|
||||||
if (stream.peek() === '=' || stream.peek() === '!') {
|
if (stream.peek() === '=' || stream.peek() === '!') {
|
||||||
state.inAttributeName = false;
|
state.inAttributeName = false;
|
||||||
state.jsState = jsMode.startState();
|
state.jsState = CodeMirror.startState(jsMode);
|
||||||
if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') {
|
if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') {
|
||||||
state.attributeIsType = true;
|
state.attributeIsType = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -492,7 +492,7 @@ CodeMirror.defineMode('jade', function (config) {
|
||||||
if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) {
|
if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) {
|
||||||
if (state.innerMode) {
|
if (state.innerMode) {
|
||||||
if (!state.innerState) {
|
if (!state.innerState) {
|
||||||
state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {};
|
state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {};
|
||||||
}
|
}
|
||||||
return stream.hideFirstChars(state.indentOf + 2, function () {
|
return stream.hideFirstChars(state.indentOf + 2, function () {
|
||||||
return state.innerMode.token(stream, state.innerState) || true;
|
return state.innerMode.token(stream, state.innerState) || true;
|
||||||
|
|
|
@ -42,7 +42,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
"in": operator, "typeof": operator, "instanceof": operator,
|
"in": operator, "typeof": operator, "instanceof": operator,
|
||||||
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
|
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
|
||||||
"this": kw("this"), "class": kw("class"), "super": kw("atom"),
|
"this": kw("this"), "class": kw("class"), "super": kw("atom"),
|
||||||
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C
|
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
|
||||||
|
"await": C, "async": kw("async")
|
||||||
};
|
};
|
||||||
|
|
||||||
// Extend the 'normal' keywords with the TypeScript language extensions
|
// Extend the 'normal' keywords with the TypeScript language extensions
|
||||||
|
@ -366,6 +367,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
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 == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
|
if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
|
||||||
|
if (type == "async") return cont(statement)
|
||||||
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
||||||
}
|
}
|
||||||
function expression(type) {
|
function expression(type) {
|
||||||
|
@ -488,17 +490,17 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
if (type == "(") return pass(functiondef);
|
if (type == "(") return pass(functiondef);
|
||||||
}
|
}
|
||||||
function commasep(what, end) {
|
function commasep(what, end) {
|
||||||
function proceed(type) {
|
function proceed(type, value) {
|
||||||
if (type == ",") {
|
if (type == ",") {
|
||||||
var lex = cx.state.lexical;
|
var lex = cx.state.lexical;
|
||||||
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
|
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
|
||||||
return cont(what, proceed);
|
return cont(what, proceed);
|
||||||
}
|
}
|
||||||
if (type == end) return cont();
|
if (type == end || value == end) return cont();
|
||||||
return cont(expect(end));
|
return cont(expect(end));
|
||||||
}
|
}
|
||||||
return function(type) {
|
return function(type, value) {
|
||||||
if (type == end) return cont();
|
if (type == end || value == end) return cont();
|
||||||
return pass(what, proceed);
|
return pass(what, proceed);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -512,13 +514,17 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
return pass(statement, block);
|
return pass(statement, block);
|
||||||
}
|
}
|
||||||
function maybetype(type) {
|
function maybetype(type) {
|
||||||
if (isTS && type == ":") return cont(typedef);
|
if (isTS && type == ":") return cont(typeexpr);
|
||||||
}
|
}
|
||||||
function maybedefault(_, value) {
|
function maybedefault(_, value) {
|
||||||
if (value == "=") return cont(expressionNoComma);
|
if (value == "=") return cont(expressionNoComma);
|
||||||
}
|
}
|
||||||
function typedef(type) {
|
function typeexpr(type) {
|
||||||
if (type == "variable") {cx.marked = "variable-3"; return cont();}
|
if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);}
|
||||||
|
}
|
||||||
|
function afterType(type, value) {
|
||||||
|
if (value == "<") return cont(commasep(typeexpr, ">"), afterType)
|
||||||
|
if (type == "[") return cont(expect("]"), afterType)
|
||||||
}
|
}
|
||||||
function vardef() {
|
function vardef() {
|
||||||
return pass(pattern, maybetype, maybeAssign, vardefCont);
|
return pass(pattern, maybetype, maybeAssign, vardefCont);
|
||||||
|
@ -573,7 +579,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||||
function functiondef(type, value) {
|
function functiondef(type, value) {
|
||||||
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
|
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
|
||||||
if (type == "variable") {register(value); return cont(functiondef);}
|
if (type == "variable") {register(value); return cont(functiondef);}
|
||||||
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext);
|
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
|
||||||
}
|
}
|
||||||
function funarg(type) {
|
function funarg(type) {
|
||||||
if (type == "spread") return cont(funarg);
|
if (type == "spread") return cont(funarg);
|
||||||
|
|
|
@ -218,7 +218,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
||||||
state.fencedChars = match[1]
|
state.fencedChars = match[1]
|
||||||
// try switching mode
|
// try switching mode
|
||||||
state.localMode = getMode(match[2]);
|
state.localMode = getMode(match[2]);
|
||||||
if (state.localMode) state.localState = state.localMode.startState();
|
if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
|
||||||
state.f = state.block = local;
|
state.f = state.block = local;
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
||||||
state.code = -1
|
state.code = -1
|
||||||
|
@ -437,13 +437,13 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
||||||
return tokenTypes.image;
|
return tokenTypes.image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch === '[' && stream.match(/.*\](\(.*\)| ?\[.*\])/, false)) {
|
if (ch === '[' && stream.match(/[^\]]*\](\(.*\)| ?\[.*?\])/, false)) {
|
||||||
state.linkText = true;
|
state.linkText = true;
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "link";
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
||||||
return getType(state);
|
return getType(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch === ']' && state.linkText && stream.match(/\(.*\)| ?\[.*\]/, false)) {
|
if (ch === ']' && state.linkText && stream.match(/\(.*?\)| ?\[.*?\]/, false)) {
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "link";
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
||||||
var type = getType(state);
|
var type = getType(state);
|
||||||
state.linkText = false;
|
state.linkText = false;
|
||||||
|
@ -596,7 +596,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
||||||
}
|
}
|
||||||
var ch = stream.next();
|
var ch = stream.next();
|
||||||
if (ch === '(' || ch === '[') {
|
if (ch === '(' || ch === '[') {
|
||||||
state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
|
state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]", 0);
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
||||||
state.linkHref = true;
|
state.linkHref = true;
|
||||||
return getType(state);
|
return getType(state);
|
||||||
|
@ -604,6 +604,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
||||||
return 'error';
|
return 'error';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var linkRE = {
|
||||||
|
")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
|
||||||
|
"]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/
|
||||||
|
}
|
||||||
|
|
||||||
function getLinkHrefInside(endChar) {
|
function getLinkHrefInside(endChar) {
|
||||||
return function(stream, state) {
|
return function(stream, state) {
|
||||||
var ch = stream.next();
|
var ch = stream.next();
|
||||||
|
@ -616,10 +621,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
||||||
return returnState;
|
return returnState;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream.match(inlineRE(endChar), true)) {
|
stream.match(linkRE[endChar])
|
||||||
stream.backUp(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
state.linkHref = true;
|
state.linkHref = true;
|
||||||
return getType(state);
|
return getType(state);
|
||||||
};
|
};
|
||||||
|
@ -667,18 +669,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
||||||
return tokenTypes.linkHref + " url";
|
return tokenTypes.linkHref + " url";
|
||||||
}
|
}
|
||||||
|
|
||||||
var savedInlineRE = [];
|
|
||||||
function inlineRE(endChar) {
|
|
||||||
if (!savedInlineRE[endChar]) {
|
|
||||||
// Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741)
|
|
||||||
endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
|
|
||||||
// Match any non-endChar, escaped character, as well as the closing
|
|
||||||
// endChar.
|
|
||||||
savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')');
|
|
||||||
}
|
|
||||||
return savedInlineRE[endChar];
|
|
||||||
}
|
|
||||||
|
|
||||||
var mode = {
|
var mode = {
|
||||||
startState: function() {
|
startState: function() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -782,6 +782,9 @@
|
||||||
MT("emStrongMixed",
|
MT("emStrongMixed",
|
||||||
"[em *foo][em&strong __bar_hello** world]");
|
"[em *foo][em&strong __bar_hello** world]");
|
||||||
|
|
||||||
|
MT("linkWithNestedParens",
|
||||||
|
"[link [[foo]]][string&url (bar(baz))]")
|
||||||
|
|
||||||
// These characters should be escaped:
|
// These characters should be escaped:
|
||||||
// \ backslash
|
// \ backslash
|
||||||
// ` backtick
|
// ` backtick
|
||||||
|
|
44
public/vendor/codemirror/mode/mbox/index.html
vendored
Normal file
44
public/vendor/codemirror/mode/mbox/index.html
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<!doctype html>
|
||||||
|
|
||||||
|
<title>CodeMirror: mbox mode</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<link rel=stylesheet href="../../doc/docs.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
|
<script src="../../lib/codemirror.js"></script>
|
||||||
|
<script src="mbox.js"></script>
|
||||||
|
<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
|
||||||
|
<div id=nav>
|
||||||
|
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="../../index.html">Home</a>
|
||||||
|
<li><a href="../../doc/manual.html">Manual</a>
|
||||||
|
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../index.html">Language modes</a>
|
||||||
|
<li><a class=active href="#">mbox</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<h2>mbox mode</h2>
|
||||||
|
<form><textarea id="code" name="code">
|
||||||
|
From timothygu99@gmail.com Sun Apr 17 01:40:43 2016
|
||||||
|
From: Timothy Gu <timothygu99@gmail.com>
|
||||||
|
Date: Sat, 16 Apr 2016 18:40:43 -0700
|
||||||
|
Subject: mbox mode
|
||||||
|
Message-ID: <Z8d+bTT50U/az94FZnyPkDjZmW0=@gmail.com>
|
||||||
|
|
||||||
|
mbox mode is working!
|
||||||
|
|
||||||
|
Timothy
|
||||||
|
</textarea></form>
|
||||||
|
<script>
|
||||||
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p><strong>MIME types defined:</strong> <code>application/mbox</code>.</p>
|
||||||
|
|
||||||
|
</article>
|
129
public/vendor/codemirror/mode/mbox/mbox.js
vendored
Normal file
129
public/vendor/codemirror/mode/mbox/mbox.js
vendored
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
|
(function(mod) {
|
||||||
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
|
mod(require("../../lib/codemirror"));
|
||||||
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
|
define(["../../lib/codemirror"], mod);
|
||||||
|
else // Plain browser env
|
||||||
|
mod(CodeMirror);
|
||||||
|
})(function(CodeMirror) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var rfc2822 = [
|
||||||
|
"From", "Sender", "Reply-To", "To", "Cc", "Bcc", "Message-ID",
|
||||||
|
"In-Reply-To", "References", "Resent-From", "Resent-Sender", "Resent-To",
|
||||||
|
"Resent-Cc", "Resent-Bcc", "Resent-Message-ID", "Return-Path", "Received"
|
||||||
|
];
|
||||||
|
var rfc2822NoEmail = [
|
||||||
|
"Date", "Subject", "Comments", "Keywords", "Resent-Date"
|
||||||
|
];
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("hintWords", "mbox", rfc2822.concat(rfc2822NoEmail));
|
||||||
|
|
||||||
|
var whitespace = /^[ \t]/;
|
||||||
|
var separator = /^From /; // See RFC 4155
|
||||||
|
var rfc2822Header = new RegExp("^(" + rfc2822.join("|") + "): ");
|
||||||
|
var rfc2822HeaderNoEmail = new RegExp("^(" + rfc2822NoEmail.join("|") + "): ");
|
||||||
|
var header = /^[^:]+:/; // Optional fields defined in RFC 2822
|
||||||
|
var email = /^[^ ]+@[^ ]+/;
|
||||||
|
var untilEmail = /^.*?(?=[^ ]+?@[^ ]+)/;
|
||||||
|
var bracketedEmail = /^<.*?>/;
|
||||||
|
var untilBracketedEmail = /^.*?(?=<.*>)/;
|
||||||
|
|
||||||
|
function styleForHeader(header) {
|
||||||
|
if (header === "Subject") return "header";
|
||||||
|
return "string";
|
||||||
|
}
|
||||||
|
|
||||||
|
function readToken(stream, state) {
|
||||||
|
if (stream.sol()) {
|
||||||
|
// From last line
|
||||||
|
state.inSeparator = false;
|
||||||
|
if (state.inHeader && stream.match(whitespace)) {
|
||||||
|
// Header folding
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
state.inHeader = false;
|
||||||
|
state.header = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stream.match(separator)) {
|
||||||
|
state.inHeaders = true;
|
||||||
|
state.inSeparator = true;
|
||||||
|
return "atom";
|
||||||
|
}
|
||||||
|
|
||||||
|
var match;
|
||||||
|
var emailPermitted = false;
|
||||||
|
if ((match = stream.match(rfc2822HeaderNoEmail)) ||
|
||||||
|
(emailPermitted = true) && (match = stream.match(rfc2822Header))) {
|
||||||
|
state.inHeaders = true;
|
||||||
|
state.inHeader = true;
|
||||||
|
state.emailPermitted = emailPermitted;
|
||||||
|
state.header = match[1];
|
||||||
|
return "atom";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use vim's heuristics: recognize custom headers only if the line is in a
|
||||||
|
// block of legitimate headers.
|
||||||
|
if (state.inHeaders && (match = stream.match(header))) {
|
||||||
|
state.inHeader = true;
|
||||||
|
state.emailPermitted = true;
|
||||||
|
state.header = match[1];
|
||||||
|
return "atom";
|
||||||
|
}
|
||||||
|
|
||||||
|
state.inHeaders = false;
|
||||||
|
stream.skipToEnd();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.inSeparator) {
|
||||||
|
if (stream.match(email)) return "link";
|
||||||
|
if (stream.match(untilEmail)) return "atom";
|
||||||
|
stream.skipToEnd();
|
||||||
|
return "atom";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.inHeader) {
|
||||||
|
var style = styleForHeader(state.header);
|
||||||
|
|
||||||
|
if (state.emailPermitted) {
|
||||||
|
if (stream.match(bracketedEmail)) return style + " link";
|
||||||
|
if (stream.match(untilBracketedEmail)) return style;
|
||||||
|
}
|
||||||
|
stream.skipToEnd();
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.skipToEnd();
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeMirror.defineMode("mbox", function() {
|
||||||
|
return {
|
||||||
|
startState: function() {
|
||||||
|
return {
|
||||||
|
// Is in a mbox separator
|
||||||
|
inSeparator: false,
|
||||||
|
// Is in a mail header
|
||||||
|
inHeader: false,
|
||||||
|
// If bracketed email is permitted. Only applicable when inHeader
|
||||||
|
emailPermitted: false,
|
||||||
|
// Name of current header
|
||||||
|
header: null,
|
||||||
|
// Is in a region of mail headers
|
||||||
|
inHeaders: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
token: readToken,
|
||||||
|
blankLine: function(state) {
|
||||||
|
state.inHeaders = state.inSeparator = state.inHeader = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineMIME("application/mbox", "mbox");
|
||||||
|
});
|
1
public/vendor/codemirror/mode/meta.js
vendored
1
public/vendor/codemirror/mode/meta.js
vendored
|
@ -87,6 +87,7 @@
|
||||||
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
||||||
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
|
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
|
||||||
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
||||||
|
{name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]},
|
||||||
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
||||||
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
||||||
{name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
|
{name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
|
||||||
|
|
2
public/vendor/codemirror/mode/pegjs/pegjs.js
vendored
2
public/vendor/codemirror/mode/pegjs/pegjs.js
vendored
|
@ -81,7 +81,7 @@ CodeMirror.defineMode("pegjs", function (config) {
|
||||||
return "comment";
|
return "comment";
|
||||||
} else if (state.braced || stream.peek() === '{') {
|
} else if (state.braced || stream.peek() === '{') {
|
||||||
if (state.localState === null) {
|
if (state.localState === null) {
|
||||||
state.localState = jsMode.startState();
|
state.localState = CodeMirror.startState(jsMode);
|
||||||
}
|
}
|
||||||
var token = jsMode.token(stream, state.localState);
|
var token = jsMode.token(stream, state.localState);
|
||||||
var text = stream.current();
|
var text = stream.current();
|
||||||
|
|
2
public/vendor/codemirror/mode/php/php.js
vendored
2
public/vendor/codemirror/mode/php/php.js
vendored
File diff suppressed because one or more lines are too long
48
public/vendor/codemirror/mode/python/python.js
vendored
48
public/vendor/codemirror/mode/python/python.js
vendored
|
@ -32,13 +32,6 @@
|
||||||
"sorted", "staticmethod", "str", "sum", "super", "tuple",
|
"sorted", "staticmethod", "str", "sum", "super", "tuple",
|
||||||
"type", "vars", "zip", "__import__", "NotImplemented",
|
"type", "vars", "zip", "__import__", "NotImplemented",
|
||||||
"Ellipsis", "__debug__"];
|
"Ellipsis", "__debug__"];
|
||||||
var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile",
|
|
||||||
"file", "intern", "long", "raw_input", "reduce", "reload",
|
|
||||||
"unichr", "unicode", "xrange", "False", "True", "None"],
|
|
||||||
keywords: ["exec", "print"]};
|
|
||||||
var py3 = {builtins: ["ascii", "bytes", "exec", "print"],
|
|
||||||
keywords: ["nonlocal", "False", "True", "None", "async", "await"]};
|
|
||||||
|
|
||||||
CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
|
CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
|
||||||
|
|
||||||
function top(state) {
|
function top(state) {
|
||||||
|
@ -53,15 +46,6 @@
|
||||||
var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
|
var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
|
||||||
var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
|
var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
|
||||||
|
|
||||||
if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
|
|
||||||
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
|
|
||||||
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
|
|
||||||
var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
|
|
||||||
} else {
|
|
||||||
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
|
|
||||||
var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
|
|
||||||
}
|
|
||||||
|
|
||||||
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
|
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
|
||||||
|
|
||||||
var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
|
var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
|
||||||
|
@ -71,13 +55,21 @@
|
||||||
if (parserConf.extra_builtins != undefined)
|
if (parserConf.extra_builtins != undefined)
|
||||||
myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
|
myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
|
||||||
|
|
||||||
if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
|
var py3 = parserConf.version && parseInt(parserConf.version, 10) == 3
|
||||||
myKeywords = myKeywords.concat(py3.keywords);
|
if (py3) {
|
||||||
myBuiltins = myBuiltins.concat(py3.builtins);
|
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
|
||||||
var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i");
|
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
|
||||||
|
var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
|
||||||
|
myKeywords = myKeywords.concat(["nonlocal", "False", "True", "None", "async", "await"]);
|
||||||
|
myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]);
|
||||||
|
var stringPrefixes = new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))", "i");
|
||||||
} else {
|
} else {
|
||||||
myKeywords = myKeywords.concat(py2.keywords);
|
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
|
||||||
myBuiltins = myBuiltins.concat(py2.builtins);
|
var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
|
||||||
|
myKeywords = myKeywords.concat(["exec", "print"]);
|
||||||
|
myBuiltins = myBuiltins.concat(["apply", "basestring", "buffer", "cmp", "coerce", "execfile",
|
||||||
|
"file", "intern", "long", "raw_input", "reduce", "reload",
|
||||||
|
"unichr", "unicode", "xrange", "False", "True", "None"]);
|
||||||
var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
|
var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
|
||||||
}
|
}
|
||||||
var keywords = wordRegexp(myKeywords);
|
var keywords = wordRegexp(myKeywords);
|
||||||
|
@ -249,16 +241,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function tokenLexer(stream, state) {
|
function tokenLexer(stream, state) {
|
||||||
|
if (stream.sol()) state.beginningOfLine = true;
|
||||||
|
|
||||||
var style = state.tokenize(stream, state);
|
var style = state.tokenize(stream, state);
|
||||||
var current = stream.current();
|
var current = stream.current();
|
||||||
|
|
||||||
// Handle decorators
|
// Handle decorators
|
||||||
if (current == "@") {
|
if (state.beginningOfLine && current == "@")
|
||||||
if (parserConf.version && parseInt(parserConf.version, 10) == 3)
|
return stream.match(identifiers, false) ? "meta" : py3 ? "operator" : ERRORCLASS;
|
||||||
return stream.match(identifiers, false) ? "meta" : "operator";
|
|
||||||
else
|
if (/\S/.test(current)) state.beginningOfLine = false;
|
||||||
return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((style == "variable" || style == "builtin")
|
if ((style == "variable" || style == "builtin")
|
||||||
&& state.lastToken == "meta")
|
&& state.lastToken == "meta")
|
||||||
|
|
30
public/vendor/codemirror/mode/python/test.js
vendored
Normal file
30
public/vendor/codemirror/mode/python/test.js
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var mode = CodeMirror.getMode({indentUnit: 4},
|
||||||
|
{name: "python",
|
||||||
|
version: 3,
|
||||||
|
singleLineStringErrors: false});
|
||||||
|
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
||||||
|
|
||||||
|
// Error, because "foobarhello" is neither a known type or property, but
|
||||||
|
// property was expected (after "and"), and it should be in parentheses.
|
||||||
|
MT("decoratorStartOfLine",
|
||||||
|
"[meta @dec]",
|
||||||
|
"[keyword def] [def function]():",
|
||||||
|
" [keyword pass]");
|
||||||
|
|
||||||
|
MT("decoratorIndented",
|
||||||
|
"[keyword class] [def Foo]:",
|
||||||
|
" [meta @dec]",
|
||||||
|
" [keyword def] [def function]():",
|
||||||
|
" [keyword pass]");
|
||||||
|
|
||||||
|
MT("matmulWithSpace:", "[variable a] [operator @] [variable b]");
|
||||||
|
MT("matmulWithoutSpace:", "[variable a][operator @][variable b]");
|
||||||
|
MT("matmulSpaceBefore:", "[variable a] [operator @][variable b]");
|
||||||
|
|
||||||
|
MT("fValidStringPrefix", "[string f'this is a {formatted} string']");
|
||||||
|
MT("uValidStringPrefix", "[string u'this is an unicode string']");
|
||||||
|
})();
|
8
public/vendor/codemirror/mode/slim/slim.js
vendored
8
public/vendor/codemirror/mode/slim/slim.js
vendored
|
@ -165,7 +165,7 @@
|
||||||
};
|
};
|
||||||
return function(stream, state) {
|
return function(stream, state) {
|
||||||
rubyState = state.rubyState;
|
rubyState = state.rubyState;
|
||||||
state.rubyState = rubyMode.startState();
|
state.rubyState = CodeMirror.startState(rubyMode);
|
||||||
state.tokenize = runSplat;
|
state.tokenize = runSplat;
|
||||||
return ruby(stream, state);
|
return ruby(stream, state);
|
||||||
};
|
};
|
||||||
|
@ -317,7 +317,7 @@
|
||||||
|
|
||||||
function startSubMode(mode, state) {
|
function startSubMode(mode, state) {
|
||||||
var subMode = getMode(mode);
|
var subMode = getMode(mode);
|
||||||
var subState = subMode.startState && subMode.startState();
|
var subState = CodeMirror.startState(subMode);
|
||||||
|
|
||||||
state.subMode = subMode;
|
state.subMode = subMode;
|
||||||
state.subState = subState;
|
state.subState = subState;
|
||||||
|
@ -507,8 +507,8 @@
|
||||||
var mode = {
|
var mode = {
|
||||||
// default to html mode
|
// default to html mode
|
||||||
startState: function() {
|
startState: function() {
|
||||||
var htmlState = htmlMode.startState();
|
var htmlState = CodeMirror.startState(htmlMode);
|
||||||
var rubyState = rubyMode.startState();
|
var rubyState = CodeMirror.startState(rubyMode);
|
||||||
return {
|
return {
|
||||||
htmlState: htmlState,
|
htmlState: htmlState,
|
||||||
rubyState: rubyState,
|
rubyState: rubyState,
|
||||||
|
|
|
@ -85,6 +85,7 @@ var singleOperators = /^[:<=>?]/;
|
||||||
var integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/;
|
var integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/;
|
||||||
var floats = /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/;
|
var floats = /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/;
|
||||||
var identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/;
|
var identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/;
|
||||||
|
var identifiersEnd = /^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/;
|
||||||
var strings = /^"[^"]*"/;
|
var strings = /^"[^"]*"/;
|
||||||
var multilineComments = /^\/\*.*?\*\//;
|
var multilineComments = /^\/\*.*?\*\//;
|
||||||
var multilineCommentsStart = /^\/\*.*/;
|
var multilineCommentsStart = /^\/\*.*/;
|
||||||
|
@ -122,13 +123,12 @@ function readToken(stream, state) {
|
||||||
if (stream.match(strings)) return "string";
|
if (stream.match(strings)) return "string";
|
||||||
|
|
||||||
// identifier
|
// identifier
|
||||||
if (stream.match(identifiers)) {
|
if (state.startDef && stream.match(identifiers)) return "def";
|
||||||
if (state.startDef) return "def";
|
|
||||||
if (state.endDef && stream.match(/^\s*;/, false)) {
|
if (state.endDef && stream.match(identifiersEnd)) {
|
||||||
state.endDef = false;
|
state.endDef = false;
|
||||||
return "def";
|
return "def";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (stream.match(keywords)) return "keyword";
|
if (stream.match(keywords)) return "keyword";
|
||||||
|
|
||||||
|
|
72
public/vendor/codemirror/mode/yacas/yacas.js
vendored
72
public/vendor/codemirror/mode/yacas/yacas.js
vendored
|
@ -16,6 +16,19 @@
|
||||||
|
|
||||||
CodeMirror.defineMode('yacas', function(_config, _parserConfig) {
|
CodeMirror.defineMode('yacas', function(_config, _parserConfig) {
|
||||||
|
|
||||||
|
function words(str) {
|
||||||
|
var obj = {}, words = str.split(" ");
|
||||||
|
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
var bodiedOps = words("Assert BackQuote D Defun Deriv For ForEach FromFile " +
|
||||||
|
"FromString Function Integrate InverseTaylor Limit " +
|
||||||
|
"LocalSymbols Macro MacroRule MacroRulePattern " +
|
||||||
|
"NIntegrate Rule RulePattern Subst TD TExplicitSum " +
|
||||||
|
"TSum Taylor Taylor1 Taylor2 Taylor3 ToFile " +
|
||||||
|
"ToStdout ToString TraceRule Until While");
|
||||||
|
|
||||||
// patterns
|
// patterns
|
||||||
var pFloatForm = "(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)";
|
var pFloatForm = "(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)";
|
||||||
var pIdentifier = "(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)";
|
var pIdentifier = "(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)";
|
||||||
|
@ -53,6 +66,33 @@ CodeMirror.defineMode('yacas', function(_config, _parserConfig) {
|
||||||
// go back one character
|
// go back one character
|
||||||
stream.backUp(1);
|
stream.backUp(1);
|
||||||
|
|
||||||
|
// update scope info
|
||||||
|
var m = stream.match(/^(\w+)\s*\(/, false);
|
||||||
|
if (m !== null && bodiedOps.hasOwnProperty(m[1]))
|
||||||
|
state.scopes.push('bodied');
|
||||||
|
|
||||||
|
var scope = currentScope(state);
|
||||||
|
|
||||||
|
if (scope === 'bodied' && ch === '[')
|
||||||
|
state.scopes.pop();
|
||||||
|
|
||||||
|
if (ch === '[' || ch === '{' || ch === '(')
|
||||||
|
state.scopes.push(ch);
|
||||||
|
|
||||||
|
scope = currentScope(state);
|
||||||
|
|
||||||
|
if (scope === '[' && ch === ']' ||
|
||||||
|
scope === '{' && ch === '}' ||
|
||||||
|
scope === '(' && ch === ')')
|
||||||
|
state.scopes.pop();
|
||||||
|
|
||||||
|
if (ch === ';') {
|
||||||
|
while (scope === 'bodied') {
|
||||||
|
state.scopes.pop();
|
||||||
|
scope = currentScope(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// look for ordered rules
|
// look for ordered rules
|
||||||
if (stream.match(/\d+ *#/, true, false)) {
|
if (stream.match(/\d+ *#/, true, false)) {
|
||||||
return 'qualifier';
|
return 'qualifier';
|
||||||
|
@ -111,20 +151,46 @@ CodeMirror.defineMode('yacas', function(_config, _parserConfig) {
|
||||||
function tokenComment(stream, state) {
|
function tokenComment(stream, state) {
|
||||||
var prev, next;
|
var prev, next;
|
||||||
while((next = stream.next()) != null) {
|
while((next = stream.next()) != null) {
|
||||||
if (prev === '*' && next === '/')
|
if (prev === '*' && next === '/') {
|
||||||
|
state.tokenize = tokenBase;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
prev = next;
|
prev = next;
|
||||||
}
|
}
|
||||||
state.tokenize = tokenBase;
|
|
||||||
return 'comment';
|
return 'comment';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function currentScope(state) {
|
||||||
|
var scope = null;
|
||||||
|
if (state.scopes.length > 0)
|
||||||
|
scope = state.scopes[state.scopes.length - 1];
|
||||||
|
return scope;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
|
startState: function() {
|
||||||
|
return {
|
||||||
|
tokenize: tokenBase,
|
||||||
|
scopes: []
|
||||||
|
};
|
||||||
|
},
|
||||||
token: function(stream, state) {
|
token: function(stream, state) {
|
||||||
if (stream.eatSpace()) return null;
|
if (stream.eatSpace()) return null;
|
||||||
return state.tokenize(stream, state);
|
return state.tokenize(stream, state);
|
||||||
},
|
},
|
||||||
|
indent: function(state, textAfter) {
|
||||||
|
if (state.tokenize !== tokenBase && state.tokenize !== null)
|
||||||
|
return CodeMirror.Pass;
|
||||||
|
|
||||||
|
var delta = 0;
|
||||||
|
if (textAfter === ']' || textAfter === '];' ||
|
||||||
|
textAfter === '}' || textAfter === '};' ||
|
||||||
|
textAfter === ');')
|
||||||
|
delta = -1;
|
||||||
|
|
||||||
|
return (state.scopes.length + delta) * _config.indentUnit;
|
||||||
|
},
|
||||||
|
electricChars: "{}[]();",
|
||||||
blockCommentStart: "/*",
|
blockCommentStart: "/*",
|
||||||
blockCommentEnd: "*/",
|
blockCommentEnd: "*/",
|
||||||
lineComment: "//"
|
lineComment: "//"
|
||||||
|
|
214
public/vendor/codemirror/theme/one-solarized.css
vendored
Normal file
214
public/vendor/codemirror/theme/one-solarized.css
vendored
Normal file
|
@ -0,0 +1,214 @@
|
||||||
|
/**
|
||||||
|
* Atom One Solarized Theme
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016 jackycute
|
||||||
|
*
|
||||||
|
* Licensed under MIT
|
||||||
|
*/
|
||||||
|
/* Editor */
|
||||||
|
.solarized .panel,
|
||||||
|
.solarized #main-toolbar {
|
||||||
|
background: #1d222a;
|
||||||
|
}
|
||||||
|
.solarized #working-set-list-container,
|
||||||
|
.solarized #editor-holder .pane-header {
|
||||||
|
background: #15181e;
|
||||||
|
}
|
||||||
|
.solarized .working-set-header,
|
||||||
|
.solarized #project-files-header .btn-alt-quiet {
|
||||||
|
background: rgba(204, 217, 255, 0.05);
|
||||||
|
}
|
||||||
|
.solarized .working-set-header > span {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.solarized .sidebar-selection,
|
||||||
|
.solarized .filetree-selection,
|
||||||
|
.solarized .sidebar-selection-extension,
|
||||||
|
.solarized .filetree-selection-extension {
|
||||||
|
background: #282c34;
|
||||||
|
}
|
||||||
|
.solarized #status-bar,
|
||||||
|
.solarized #status-indicators {
|
||||||
|
background: #15181e;
|
||||||
|
border-top-color: #1d222a;
|
||||||
|
}
|
||||||
|
.solarized a,
|
||||||
|
.solarized .open-files-container li.selected a {
|
||||||
|
color: #528bff;
|
||||||
|
}
|
||||||
|
/* Code Styling */
|
||||||
|
.cm-s-one-solarized.CodeMirror,
|
||||||
|
.cm-s-one-solarized .CodeMirror-scroll {
|
||||||
|
/* background-color: #282c34;*/
|
||||||
|
background-color: #fdf6e3;
|
||||||
|
color: #657b83;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-activeline-background {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror-focused .CodeMirror-activeline-background {
|
||||||
|
background: #eee8d5;
|
||||||
|
}
|
||||||
|
.show-line-padding .cm-s-one-solarized.CodeMirror-focused .CodeMirror-activeline-background {
|
||||||
|
box-shadow: inset 15px 0 0 0 #000;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror-focused .CodeMirror-activeline .CodeMirror-gutter-elt {
|
||||||
|
background: transparent;
|
||||||
|
color: #5c6370;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror-focused .CodeMirror-activeline .inline-widget .CodeMirror-gutter-elt {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-string-2,
|
||||||
|
.cm-s-one-solarized .cm-hr {
|
||||||
|
color: #2aa198;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-number,
|
||||||
|
.cm-s-one-solarized .cm-attribute,
|
||||||
|
.cm-s-one-solarized .cm-qualifier,
|
||||||
|
.cm-s-one-solarized .cm-plus,
|
||||||
|
.cm-s-one-solarized .cm-atom {
|
||||||
|
color: #b58900;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-def {
|
||||||
|
color: #c678dd;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-property,
|
||||||
|
.cm-s-one-solarized .cm-variable,
|
||||||
|
.cm-s-one-solarized .cm-variable-2,
|
||||||
|
.cm-s-one-solarized .cm-variable-3,
|
||||||
|
.cm-s-one-solarized .cm-operator,
|
||||||
|
/*.cm-meta,*/
|
||||||
|
.cm-s-one-solarized .cm-bracket {
|
||||||
|
color: #b58900;
|
||||||
|
}
|
||||||
|
/*borrow from tomorrow-night-eighties*/
|
||||||
|
.cm-s-one-solarized .cm-variable {
|
||||||
|
color: #839496;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-variable-2 {
|
||||||
|
color: #cb4b16;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-one-solarized .cm-comment {
|
||||||
|
color: #93a1a1;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-error,
|
||||||
|
.cm-s-one-solarized .cm-minus {
|
||||||
|
color: #be5046;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-header {
|
||||||
|
color: #268bd2;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-link {
|
||||||
|
color: #2aa198;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-rangeinfo {
|
||||||
|
color: #c678dd;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-keyword,
|
||||||
|
.cm-s-one-solarized .cm-builtin,
|
||||||
|
.cm-s-one-solarized .cm-tag {
|
||||||
|
color: #268bd2;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .cm-string {
|
||||||
|
/* color: #98c379;*/
|
||||||
|
color: #cb4b16;
|
||||||
|
}
|
||||||
|
/* Extra CSS */
|
||||||
|
.cm-s-one-solarized .CodeMirror-searching {
|
||||||
|
color: #fff !important;
|
||||||
|
border: 1px solid #1e3f47;
|
||||||
|
margin: 0 -1px;
|
||||||
|
background-color: rgba(147, 161, 161, 0.09);
|
||||||
|
box-shadow: 0px 0px 6px rgba(66, 133, 244, 0.4);
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-searching.searching-current-match {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #1e3f47;
|
||||||
|
box-shadow: 0px 0px 6px rgba(66, 133, 244, 0.8);
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-cursor {
|
||||||
|
border-left: 2px solid #1e3f47 !important;
|
||||||
|
}
|
||||||
|
.cm-fat-cursor .CodeMirror-cursor {
|
||||||
|
border-left: 2px solid #667b83 !important;
|
||||||
|
background: #667b83;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-gutters {
|
||||||
|
/* background-color: #282c34;*/
|
||||||
|
background-color: #eee8d5;
|
||||||
|
border-right: 1px solid rgba(147, 161, 161, 0.05);
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-linenumber {
|
||||||
|
color: #6f838c;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror .CodeMirror-selected {
|
||||||
|
background: rgba(147, 161, 161, 0.05);
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror-focused .CodeMirror-selected {
|
||||||
|
background: rgba(147, 161, 161, 0.09);
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-matchingbracket,
|
||||||
|
.cm-s-one-solarized .CodeMirror-matchingtag {
|
||||||
|
/* Ensure visibility against gray inline editor background */
|
||||||
|
background-color: rgba(147, 161, 161, 0.09);
|
||||||
|
color: #657b83 !important;
|
||||||
|
border-bottom: 1px solid #1e3f47;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-overwrite .CodeMirror-cursor {
|
||||||
|
border-left: none !important;
|
||||||
|
border-bottom: 1px solid #fff;
|
||||||
|
width: 0.5em;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror .CodeMirror {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror .CodeMirror .CodeMirror-gutters {
|
||||||
|
background: transparent;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror .CodeMirror .CodeMirror-activeline-background {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror .CodeMirror .CodeMirror-activeline .CodeMirror-gutter-elt {
|
||||||
|
background: transparent;
|
||||||
|
color: #5c6370;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror .CodeMirror-focused .CodeMirror-activeline-background {
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized.CodeMirror .CodeMirror-focused .CodeMirror-activeline .CodeMirror-gutter-elt {
|
||||||
|
background: rgba(147, 161, 161, 0.05);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-foldgutter-open:after {
|
||||||
|
color: #393e46;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-foldgutter-folded:after {
|
||||||
|
color: #5c6370;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror.over-gutter .CodeMirror-foldgutter-open:after,
|
||||||
|
.cm-s-one-solarized.CodeMirror-focused .CodeMirror-activeline .CodeMirror-foldgutter-open:after {
|
||||||
|
color: #5c6370;
|
||||||
|
}
|
||||||
|
.cm-s-one-solarized .CodeMirror-foldmarker {
|
||||||
|
border-color: #393e46;
|
||||||
|
color: #abb2bf;
|
||||||
|
background: rgba(147, 161, 161, 0.05);
|
||||||
|
}
|
||||||
|
/* Non-editor styling */
|
||||||
|
.image-view,
|
||||||
|
.not-editor {
|
||||||
|
background-color: #282c34;
|
||||||
|
}
|
||||||
|
.view-pane .image-view {
|
||||||
|
color: #abb2bf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-one-solarized .CodeMirror-overlayscroll-horizontal div,
|
||||||
|
.cm-s-one-solarized .CodeMirror-overlayscroll-vertical div {
|
||||||
|
border: 2px solid #fdf6e3;
|
||||||
|
}
|
34
public/vendor/codemirror/theme/solarized.css
vendored
34
public/vendor/codemirror/theme/solarized.css
vendored
|
@ -4,7 +4,7 @@ http://ethanschoonover.com/solarized
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Solarized color pallet
|
Solarized color palette
|
||||||
http://ethanschoonover.com/solarized/img/solarized-palette.png
|
http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -113,32 +113,34 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||||
box-shadow: inset 7px 0 12px -6px #000;
|
box-shadow: inset 7px 0 12px -6px #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gutter border and some shadow from it */
|
/* Remove gutter border */
|
||||||
.cm-s-solarized .CodeMirror-gutters {
|
.cm-s-solarized .CodeMirror-gutters {
|
||||||
border-right: 1px solid;
|
border-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gutter colors and line number styling based of color scheme (dark / light) */
|
/* Gutter colors and line number styling based of color scheme (dark / light) */
|
||||||
|
|
||||||
/* Dark */
|
/* Dark */
|
||||||
.cm-s-solarized.cm-s-dark .CodeMirror-gutters {
|
.cm-s-solarized.cm-s-dark .CodeMirror-gutters {
|
||||||
background-color: #002b36;
|
background-color: #073642;
|
||||||
border-color: #00232c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cm-s-solarized.cm-s-dark .CodeMirror-linenumber {
|
.cm-s-solarized.cm-s-dark .CodeMirror-linenumber {
|
||||||
|
color: #586e75;
|
||||||
text-shadow: #021014 0 -1px;
|
text-shadow: #021014 0 -1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Light */
|
/* Light */
|
||||||
.cm-s-solarized.cm-s-light .CodeMirror-gutters {
|
.cm-s-solarized.cm-s-light .CodeMirror-gutters {
|
||||||
background-color: #fdf6e3;
|
background-color: #eee8d5;
|
||||||
border-color: #eee8d5;
|
}
|
||||||
|
|
||||||
|
.cm-s-solarized.cm-s-light .CodeMirror-linenumber {
|
||||||
|
color: #839496;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common */
|
/* Common */
|
||||||
.cm-s-solarized .CodeMirror-linenumber {
|
.cm-s-solarized .CodeMirror-linenumber {
|
||||||
color: #586e75;
|
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
}
|
}
|
||||||
.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; }
|
.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; }
|
||||||
|
@ -149,15 +151,19 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||||
color: #586e75;
|
color: #586e75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Cursor */
|
||||||
.cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; }
|
.cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; }
|
||||||
|
|
||||||
/*
|
/* Fat cursor */
|
||||||
Active line. Negative margin compensates left padding of the text in the
|
.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #fdf6e3; }
|
||||||
view-port
|
.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #fdf6e3; }
|
||||||
*/
|
.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor { background: #586e75; }
|
||||||
|
.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor { background-color: #586e75; }
|
||||||
|
|
||||||
|
/* Active line */
|
||||||
.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background {
|
.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background {
|
||||||
background: rgba(255, 255, 255, 0.10);
|
background: rgba(255, 255, 255, 0.06);
|
||||||
}
|
}
|
||||||
.cm-s-solarized.cm-s-light .CodeMirror-activeline-background {
|
.cm-s-solarized.cm-s-light .CodeMirror-activeline-background {
|
||||||
background: rgba(0, 0, 0, 0.10);
|
background: rgba(0, 0, 0, 0.06);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue