aboutsummaryrefslogtreecommitdiff
path: root/js/codemirror/lib/runmode.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-15 20:37:48 -0800
committerJose Antonio Marquez2012-02-15 20:37:48 -0800
commit89b5e793ea88ef235b54b6e1d1c379698d3e612b (patch)
tree4d29118f35df77ca6b423119a4ff61694a442cbf /js/codemirror/lib/runmode.js
parent9d2c2a80483415d7560b00cda5519153db23e241 (diff)
parentd366c0bd1af6471511217ed574083e15059519b5 (diff)
downloadninja-89b5e793ea88ef235b54b6e1d1c379698d3e612b.tar.gz
Merge branch 'refs/heads/NinjaInternal' into Color
Diffstat (limited to 'js/codemirror/lib/runmode.js')
-rw-r--r--js/codemirror/lib/runmode.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/js/codemirror/lib/runmode.js b/js/codemirror/lib/runmode.js
deleted file mode 100644
index 163e720c..00000000
--- a/js/codemirror/lib/runmode.js
+++ /dev/null
@@ -1,27 +0,0 @@
1CodeMirror.runMode = function(string, modespec, callback) {
2 var mode = CodeMirror.getMode({indentUnit: 2}, modespec);
3 var isNode = callback.nodeType == 1;
4 if (isNode) {
5 var node = callback, accum = [];
6 callback = function(string, style) {
7 if (string == "\n")
8 accum.push("<br>");
9 else if (style)
10 accum.push("<span class=\"cm-" + CodeMirror.htmlEscape(style) + "\">" + CodeMirror.htmlEscape(string) + "</span>");
11 else
12 accum.push(CodeMirror.htmlEscape(string));
13 }
14 }
15 var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
16 for (var i = 0, e = lines.length; i < e; ++i) {
17 if (i) callback("\n");
18 var stream = new CodeMirror.StringStream(lines[i]);
19 while (!stream.eol()) {
20 var style = mode.token(stream, state);
21 callback(stream.current(), style);
22 stream.start = stream.pos;
23 }
24 }
25 if (isNode)
26 node.innerHTML = accum.join("");
27};