Skip to content
Snippets Groups Projects
Commit d47bae43 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[runmode.node addon] Include null mode

parent 70b72c7f
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,12 @@ exports.defineMode = function(name, mode) {
modes[name] = mode;
};
exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; };
exports.defineMode("null", function() {
return {token: function(stream) {stream.skipToEnd();}};
});
exports.defineMIME("text/plain", "null");
exports.getMode = function(options, spec) {
if (typeof spec == "string" && mimeModes.hasOwnProperty(spec))
spec = mimeModes[spec];
......
......@@ -27,7 +27,7 @@ CodeMirror.modeInfo.forEach(function(info) {
});
function ensureMode(name) {
if (CodeMirror.modes[name]) return;
if (CodeMirror.modes[name] || name == "null") return;
try {
require("../mode/" + name + "/" + name + ".js");
} catch(e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment