From cc23d768069bff93f8ad2bdda3e162e06fe945e1 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov <lushnikov@chromium.org> Date: Mon, 13 Jan 2014 18:16:12 +0400 Subject: [PATCH] [runmode addon] Define text/plain mode in standalone script. --- addon/runmode/runmode-standalone.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addon/runmode/runmode-standalone.js b/addon/runmode/runmode-standalone.js index 9ebde8b0..ec06ba11 100644 --- a/addon/runmode/runmode-standalone.js +++ b/addon/runmode/runmode-standalone.js @@ -91,6 +91,10 @@ CodeMirror.getMode = function (options, spec) { return mfactory(options, spec); }; CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min; +CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; +}); +CodeMirror.defineMIME("text/plain", "null"); CodeMirror.runMode = function (string, modespec, callback, options) { var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec); -- GitLab