From 8b96f91c876c03bf726da6b77af4aacc3f548a86 2014-10-29 15:57:57 From: Mateusz Paprocki Date: 2014-10-29 15:57:57 Subject: [PATCH] Allow to specify CodeMirror's syntax mode as MIME This is required for e.g. Scala, where the mode is given as text/x-scala, but the actual implementation is in clike mode. This wouldn't be an issue, but IPython loads modes lazily, so you need both mode name and MIME to resolve correct file and configure CodeMirror. --- diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 3b03d7c..492793b 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -1529,7 +1529,7 @@ define([ } this.codemirror_mode = newmode; codecell.CodeCell.options_default.cm_config.mode = newmode; - modename = newmode.name || newmode + modename = newmode.mode || newmode.name || newmode that = this; utils.requireCodeMirrorMode(modename, function () {