##// END OF EJS Templates
update CodeMirror2 to 2.32
update CodeMirror2 to 2.32

File last commit:

r8053:58574fbf
r8053:58574fbf
Show More
diff.js
32 lines | 670 B | application/javascript | JavascriptLexer
Matthias BUSSONNIER
update CodeMirror2 to 2.32
r8053 CodeMirror.defineMode("diff", function() {
var TOKEN_NAMES = {
'+': 'tag',
'-': 'string',
'@': 'meta'
};
return {
token: function(stream) {
var tw_pos = stream.string.search(/[\t ]+?$/);
if (!stream.sol() || tw_pos === 0) {
stream.skipToEnd();
return ("error " + (
TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
}
var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
if (tw_pos === -1) {
stream.skipToEnd();
} else {
stream.pos = tw_pos;
}
return token_name;
}
};
});
CodeMirror.defineMIME("text/x-diff", "diff");