codemirror-rails 4.1 → 4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codemirror/rails/version.rb +2 -2
- data/vendor/assets/javascripts/codemirror.js +133 -58
- data/vendor/assets/javascripts/codemirror/addons/comment/comment.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/display/fullscreen.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/display/placeholder.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/display/rulers.js +16 -6
- data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +28 -3
- data/vendor/assets/javascripts/codemirror/addons/edit/continuelist.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/matchbrackets.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/matchtags.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/trailingspace.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js +36 -8
- data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/markdown-fold.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +4 -1
- data/vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/css-hint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/html-hint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/javascript-hint.js +7 -2
- data/vendor/assets/javascripts/codemirror/addons/hint/python-hint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +74 -36
- data/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/hint/xml-hint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/css-lint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/javascript-lint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/json-lint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/lint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/lint/yaml-lint.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/merge/merge.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/loadmode.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/overlay.js +12 -3
- data/vendor/assets/javascripts/codemirror/addons/runmode/colorize.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode-standalone.js +4 -1
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js +4 -1
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js +4 -1
- data/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js +6 -2
- data/vendor/assets/javascripts/codemirror/addons/search/search.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/search/searchcursor.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/selection/active-line.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/selection/mark-selection.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/tern/tern.js +23 -16
- data/vendor/assets/javascripts/codemirror/addons/tern/worker.js +3 -0
- data/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js +3 -0
- data/vendor/assets/javascripts/codemirror/keymaps/emacs.js +4 -7
- data/vendor/assets/javascripts/codemirror/keymaps/sublime.js +11 -8
- data/vendor/assets/javascripts/codemirror/keymaps/vim.js +92 -33
- data/vendor/assets/javascripts/codemirror/modes/apl.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/asterisk.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/clike.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/clojure.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/cobol.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/commonlisp.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/css.js +13 -14
- data/vendor/assets/javascripts/codemirror/modes/cypher.js +146 -0
- data/vendor/assets/javascripts/codemirror/modes/d.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/diff.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/django.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/dtd.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/dylan.js +15 -0
- data/vendor/assets/javascripts/codemirror/modes/ecl.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/eiffel.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/erlang.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/fortran.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/gas.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/gfm.js +9 -1
- data/vendor/assets/javascripts/codemirror/modes/gherkin.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/go.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/groovy.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/haml.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/haskell.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/haxe.js +5 -1
- data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/http.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/jade.js +569 -81
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +5 -0
- data/vendor/assets/javascripts/codemirror/modes/jinja2.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/julia.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/livescript.js +17 -17
- data/vendor/assets/javascripts/codemirror/modes/lua.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/markdown.js +5 -3
- data/vendor/assets/javascripts/codemirror/modes/mirc.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/mllike.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/nginx.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/ntriples.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/octave.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/pascal.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/pegjs.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/perl.js +5 -0
- data/vendor/assets/javascripts/codemirror/modes/php.js +5 -2
- data/vendor/assets/javascripts/codemirror/modes/pig.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/properties.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/puppet.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/python.js +284 -328
- data/vendor/assets/javascripts/codemirror/modes/q.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/r.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/rpm.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/rst.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/ruby.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/rust.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/sass.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/scheme.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/shell.js +9 -2
- data/vendor/assets/javascripts/codemirror/modes/sieve.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/smalltalk.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/smarty.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/smartymixed.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/solr.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/sparql.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/sql.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/stex.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/tcl.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/tiki.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/toml.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/turtle.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/vb.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/vbscript.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/velocity.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/verilog.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/xml.js +4 -1
- data/vendor/assets/javascripts/codemirror/modes/xquery.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/yaml.js +3 -0
- data/vendor/assets/javascripts/codemirror/modes/z80.js +3 -0
- data/vendor/assets/stylesheets/codemirror/addons/tern/tern.css +1 -0
- data/vendor/assets/stylesheets/codemirror/themes/neo.css +40 -0
- metadata +4 -2
@@ -1,3 +1,6 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
1
4
|
(function(mod) {
|
2
5
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
6
|
mod(require("../../lib/codemirror"));
|
@@ -54,7 +57,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
54
57
|
if (/[\d.]/.test(stream.peek())) {
|
55
58
|
stream.eatWhile(/[\w.%]/);
|
56
59
|
return ret("number", "unit");
|
57
|
-
} else if (stream.match(
|
60
|
+
} else if (stream.match(/^\w+-/)) {
|
58
61
|
return ret("meta", "meta");
|
59
62
|
}
|
60
63
|
} else if (/[,+>*\/]/.test(ch)) {
|
@@ -164,7 +167,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
164
167
|
} else if (type == ":") {
|
165
168
|
return "pseudo";
|
166
169
|
} else if (allowNested && type == "(") {
|
167
|
-
return pushContext(state, stream, "
|
170
|
+
return pushContext(state, stream, "parens");
|
168
171
|
}
|
169
172
|
return state.context.type;
|
170
173
|
};
|
@@ -225,6 +228,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
225
228
|
states.parens = function(type, stream, state) {
|
226
229
|
if (type == "{" || type == "}") return popAndPass(type, stream, state);
|
227
230
|
if (type == ")") return popContext(state);
|
231
|
+
if (type == "(") return pushContext(state, stream, "parens");
|
232
|
+
if (type == "word") wordAsValue(stream);
|
228
233
|
return "parens";
|
229
234
|
};
|
230
235
|
|
@@ -300,13 +305,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
300
305
|
return "interpolation";
|
301
306
|
};
|
302
307
|
|
303
|
-
states.params = function(type, stream, state) {
|
304
|
-
if (type == ")") return popContext(state);
|
305
|
-
if (type == "{" || type == "}") return popAndPass(type, stream, state);
|
306
|
-
if (type == "word") wordAsValue(stream);
|
307
|
-
return "params";
|
308
|
-
};
|
309
|
-
|
310
308
|
return {
|
311
309
|
startState: function(base) {
|
312
310
|
return {tokenize: null,
|
@@ -329,10 +327,10 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
329
327
|
indent: function(state, textAfter) {
|
330
328
|
var cx = state.context, ch = textAfter && textAfter.charAt(0);
|
331
329
|
var indent = cx.indent;
|
332
|
-
if (cx.type == "prop" && ch == "}") cx = cx.prev;
|
330
|
+
if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
|
333
331
|
if (cx.prev &&
|
334
332
|
(ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") ||
|
335
|
-
ch == ")" && (cx.type == "parens" || cx.type == "
|
333
|
+
ch == ")" && (cx.type == "parens" || cx.type == "media_parens") ||
|
336
334
|
ch == "{" && (cx.type == "at" || cx.type == "media"))) {
|
337
335
|
indent = cx.indent - indentUnit;
|
338
336
|
cx = cx.prev;
|
@@ -422,7 +420,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
422
420
|
"marker-offset", "marks", "marquee-direction", "marquee-loop",
|
423
421
|
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
424
422
|
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
425
|
-
"nav-left", "nav-right", "nav-up", "
|
423
|
+
"nav-left", "nav-right", "nav-up", "object-fit", "object-position",
|
424
|
+
"opacity", "order", "orphans", "outline",
|
426
425
|
"outline-color", "outline-offset", "outline-style", "outline-width",
|
427
426
|
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
428
427
|
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
@@ -433,8 +432,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|
433
432
|
"region-break-before", "region-break-inside", "region-fragment",
|
434
433
|
"rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
|
435
434
|
"right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
436
|
-
"ruby-position", "ruby-span", "shape-
|
437
|
-
"speak", "speak-as", "speak-header",
|
435
|
+
"ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
|
436
|
+
"shape-outside", "size", "speak", "speak-as", "speak-header",
|
438
437
|
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
439
438
|
"tab-size", "table-layout", "target", "target-name", "target-new",
|
440
439
|
"target-position", "text-align", "text-align-last", "text-decoration",
|
@@ -0,0 +1,146 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
// By the Neo4j Team and contributors.
|
5
|
+
// https://github.com/neo4j-contrib/CodeMirror
|
6
|
+
|
7
|
+
(function(mod) {
|
8
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
9
|
+
mod(require("../../lib/codemirror"));
|
10
|
+
else if (typeof define == "function" && define.amd) // AMD
|
11
|
+
define(["../../lib/codemirror"], mod);
|
12
|
+
else // Plain browser env
|
13
|
+
mod(CodeMirror);
|
14
|
+
})(function(CodeMirror) {
|
15
|
+
"use strict";
|
16
|
+
var wordRegexp = function(words) {
|
17
|
+
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
18
|
+
};
|
19
|
+
|
20
|
+
CodeMirror.defineMode("cypher", function(config) {
|
21
|
+
var tokenBase = function(stream/*, state*/) {
|
22
|
+
var ch = stream.next(), curPunc = null;
|
23
|
+
if (ch === "\"" || ch === "'") {
|
24
|
+
stream.match(/.+?["']/);
|
25
|
+
return "string";
|
26
|
+
}
|
27
|
+
if (/[{}\(\),\.;\[\]]/.test(ch)) {
|
28
|
+
curPunc = ch;
|
29
|
+
return "node";
|
30
|
+
} else if (ch === "/" && stream.eat("/")) {
|
31
|
+
stream.skipToEnd();
|
32
|
+
return "comment";
|
33
|
+
} else if (operatorChars.test(ch)) {
|
34
|
+
stream.eatWhile(operatorChars);
|
35
|
+
return null;
|
36
|
+
} else {
|
37
|
+
stream.eatWhile(/[_\w\d]/);
|
38
|
+
if (stream.eat(":")) {
|
39
|
+
stream.eatWhile(/[\w\d_\-]/);
|
40
|
+
return "atom";
|
41
|
+
}
|
42
|
+
var word = stream.current();
|
43
|
+
if (funcs.test(word)) return "builtin";
|
44
|
+
if (preds.test(word)) return "def";
|
45
|
+
if (keywords.test(word)) return "keyword";
|
46
|
+
return "variable";
|
47
|
+
}
|
48
|
+
};
|
49
|
+
var pushContext = function(state, type, col) {
|
50
|
+
return state.context = {
|
51
|
+
prev: state.context,
|
52
|
+
indent: state.indent,
|
53
|
+
col: col,
|
54
|
+
type: type
|
55
|
+
};
|
56
|
+
};
|
57
|
+
var popContext = function(state) {
|
58
|
+
state.indent = state.context.indent;
|
59
|
+
return state.context = state.context.prev;
|
60
|
+
};
|
61
|
+
var indentUnit = config.indentUnit;
|
62
|
+
var curPunc;
|
63
|
+
var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]);
|
64
|
+
var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]);
|
65
|
+
var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "false", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
|
66
|
+
var operatorChars = /[*+\-<>=&|~%^]/;
|
67
|
+
|
68
|
+
return {
|
69
|
+
startState: function(/*base*/) {
|
70
|
+
return {
|
71
|
+
tokenize: tokenBase,
|
72
|
+
context: null,
|
73
|
+
indent: 0,
|
74
|
+
col: 0
|
75
|
+
};
|
76
|
+
},
|
77
|
+
token: function(stream, state) {
|
78
|
+
if (stream.sol()) {
|
79
|
+
if (state.context && (state.context.align == null)) {
|
80
|
+
state.context.align = false;
|
81
|
+
}
|
82
|
+
state.indent = stream.indentation();
|
83
|
+
}
|
84
|
+
if (stream.eatSpace()) {
|
85
|
+
return null;
|
86
|
+
}
|
87
|
+
var style = state.tokenize(stream, state);
|
88
|
+
if (style !== "comment" && state.context && (state.context.align == null) && state.context.type !== "pattern") {
|
89
|
+
state.context.align = true;
|
90
|
+
}
|
91
|
+
if (curPunc === "(") {
|
92
|
+
pushContext(state, ")", stream.column());
|
93
|
+
} else if (curPunc === "[") {
|
94
|
+
pushContext(state, "]", stream.column());
|
95
|
+
} else if (curPunc === "{") {
|
96
|
+
pushContext(state, "}", stream.column());
|
97
|
+
} else if (/[\]\}\)]/.test(curPunc)) {
|
98
|
+
while (state.context && state.context.type === "pattern") {
|
99
|
+
popContext(state);
|
100
|
+
}
|
101
|
+
if (state.context && curPunc === state.context.type) {
|
102
|
+
popContext(state);
|
103
|
+
}
|
104
|
+
} else if (curPunc === "." && state.context && state.context.type === "pattern") {
|
105
|
+
popContext(state);
|
106
|
+
} else if (/atom|string|variable/.test(style) && state.context) {
|
107
|
+
if (/[\}\]]/.test(state.context.type)) {
|
108
|
+
pushContext(state, "pattern", stream.column());
|
109
|
+
} else if (state.context.type === "pattern" && !state.context.align) {
|
110
|
+
state.context.align = true;
|
111
|
+
state.context.col = stream.column();
|
112
|
+
}
|
113
|
+
}
|
114
|
+
return style;
|
115
|
+
},
|
116
|
+
indent: function(state, textAfter) {
|
117
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
118
|
+
var context = state.context;
|
119
|
+
if (/[\]\}]/.test(firstChar)) {
|
120
|
+
while (context && context.type === "pattern") {
|
121
|
+
context = context.prev;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
var closing = context && firstChar === context.type;
|
125
|
+
if (!context) return 0;
|
126
|
+
if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent;
|
127
|
+
if (context.align) return context.col + (closing ? 0 : 1);
|
128
|
+
return context.indent + (closing ? 0 : indentUnit);
|
129
|
+
}
|
130
|
+
};
|
131
|
+
});
|
132
|
+
|
133
|
+
CodeMirror.modeExtensions["cypher"] = {
|
134
|
+
autoFormatLineBreaks: function(text) {
|
135
|
+
var i, lines, reProcessedPortion;
|
136
|
+
var lines = text.split("\n");
|
137
|
+
var reProcessedPortion = /\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g;
|
138
|
+
for (var i = 0; i < lines.length; i++)
|
139
|
+
lines[i] = lines[i].replace(reProcessedPortion, " \n$1 ").trim();
|
140
|
+
return lines.join("\n");
|
141
|
+
}
|
142
|
+
};
|
143
|
+
|
144
|
+
CodeMirror.defineMIME("application/x-cypher-query", "cypher");
|
145
|
+
|
146
|
+
});
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
1
4
|
(function(mod) {
|
2
5
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
6
|
mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"),
|
@@ -1,3 +1,16 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
1
14
|
CodeMirror.defineMode("dylan", function(_config) {
|
2
15
|
// Words
|
3
16
|
var words = {
|
@@ -282,3 +295,5 @@ CodeMirror.defineMode("dylan", function(_config) {
|
|
282
295
|
});
|
283
296
|
|
284
297
|
CodeMirror.defineMIME("text/x-dylan", "dylan");
|
298
|
+
|
299
|
+
});
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
1
4
|
/*jshint unused:true, eqnull:true, curly:true, bitwise:true */
|
2
5
|
/*jshint undef:true, latedef:true, trailing:true */
|
3
6
|
/*global CodeMirror:true */
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
1
4
|
(function(mod) {
|
2
5
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
6
|
mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay"));
|
@@ -30,6 +33,8 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
|
|
30
33
|
};
|
31
34
|
},
|
32
35
|
token: function(stream, state) {
|
36
|
+
state.combineTokens = null;
|
37
|
+
|
33
38
|
// Hack to prevent formatting override inside code blocks (block and inline)
|
34
39
|
if (state.codeBlock) {
|
35
40
|
if (stream.match(/^```/)) {
|
@@ -77,19 +82,22 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
|
|
77
82
|
// User/Project@SHA
|
78
83
|
// User@SHA
|
79
84
|
// SHA
|
85
|
+
state.combineTokens = true;
|
80
86
|
return "link";
|
81
87
|
} else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
|
82
88
|
// User/Project#Num
|
83
89
|
// User#Num
|
84
90
|
// #Num
|
91
|
+
state.combineTokens = true;
|
85
92
|
return "link";
|
86
93
|
}
|
87
94
|
}
|
88
|
-
if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s
|
95
|
+
if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i) &&
|
89
96
|
stream.string.slice(stream.start - 2, stream.start) != "](") {
|
90
97
|
// URLs
|
91
98
|
// Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
|
92
99
|
// And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
|
100
|
+
state.combineTokens = true;
|
93
101
|
return "link";
|
94
102
|
}
|
95
103
|
stream.next();
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
1
4
|
(function(mod) {
|
2
5
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
6
|
mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby"));
|