Skip to content

Commit deaa842

Browse files
niikmarijnh
authored andcommitted
[runmode addon] Include CodeMirror.innerMode in runmode.node.js
The markdown mode uses `CodeMirror.innerMode` which isn't defined in the stripped down node runmode. Since markdown is the only mode (AFAICT) that uses it I'm not sure if it would make more sense rewrite it to not use it but this seemed like the least risky option.
1 parent e5e2aef commit deaa842

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

addon/runmode/runmode.node.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ exports.getMode = function(options, spec) {
163163

164164
return modeObj;
165165
};
166+
167+
exports.innerMode = function(mode, state) {
168+
var info;
169+
while (mode.innerMode) {
170+
info = mode.innerMode(state);
171+
if (!info || info.mode == mode) break;
172+
state = info.state;
173+
mode = info.mode;
174+
}
175+
return info || {mode: mode, state: state};
176+
}
177+
166178
exports.registerHelper = exports.registerGlobalHelper = Math.min;
167179

168180
exports.runMode = function(string, modespec, callback, options) {

0 commit comments

Comments
 (0)