Skip to content

Commit f8d4d6a

Browse files
authored
Merge pull request #2739 from takluyver/editor-cm-mode-mime
Set CodeMirror mode using mimetype, not mode name
2 parents b099303 + 835bbd1 commit f8d4d6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

notebook/static/edit/js/editor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,10 @@ function(
150150
/** set the codemirror mode from a modeinfo struct */
151151
var that = this;
152152
utils.requireCodeMirrorMode(modeinfo, function () {
153-
that.codemirror.setOption('mode', modeinfo.mode);
153+
that.codemirror.setOption('mode', modeinfo.mime);
154154
that.events.trigger("mode_changed.Editor", modeinfo);
155+
}, function(err) {
156+
console.log('Error getting CodeMirror mode: ' + err);
155157
});
156158
};
157159

0 commit comments

Comments
 (0)