aboutsummaryrefslogtreecommitdiff
path: root/imports/codemirror/mode/diff/diff.js
diff options
context:
space:
mode:
authorJonathan Duran2012-07-17 11:42:09 -0700
committerJonathan Duran2012-07-17 11:42:09 -0700
commitb4b3e45d6684e77d361b4f8ca5be4889428320c5 (patch)
tree2156d9920ea1b7db49ed6460545fea7cda121bae /imports/codemirror/mode/diff/diff.js
parent4a87ff575693509ac578d46af26fa137c0dc3f58 (diff)
parent4f737b24c19ddc02d20f9783b8b080fc6ef11142 (diff)
downloadninja-b4b3e45d6684e77d361b4f8ca5be4889428320c5.tar.gz
Merge branch 'refs/heads/NINJA-master' into TimelineUber
Diffstat (limited to 'imports/codemirror/mode/diff/diff.js')
-rw-r--r--imports/codemirror/mode/diff/diff.js29
1 files changed, 24 insertions, 5 deletions
diff --git a/imports/codemirror/mode/diff/diff.js b/imports/codemirror/mode/diff/diff.js
index 725bb2c7..3402f3b3 100644
--- a/imports/codemirror/mode/diff/diff.js
+++ b/imports/codemirror/mode/diff/diff.js
@@ -1,11 +1,30 @@
1CodeMirror.defineMode("diff", function() { 1CodeMirror.defineMode("diff", function() {
2
3 var TOKEN_NAMES = {
4 '+': 'tag',
5 '-': 'string',
6 '@': 'meta'
7 };
8
2 return { 9 return {
3 token: function(stream) { 10 token: function(stream) {
4 var ch = stream.next(); 11 var tw_pos = stream.string.search(/[\t ]+?$/);
5 stream.skipToEnd(); 12
6 if (ch == "+") return "plus"; 13 if (!stream.sol() || tw_pos === 0) {
7 if (ch == "-") return "minus"; 14 stream.skipToEnd();
8 if (ch == "@") return "rangeinfo"; 15 return ("error " + (
16 TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
17 }
18
19 var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
20
21 if (tw_pos === -1) {
22 stream.skipToEnd();
23 } else {
24 stream.pos = tw_pos;
25 }
26
27 return token_name;
9 } 28 }
10 }; 29 };
11}); 30});