diff --git a/IPython/html/static/texteditor/js/editor.js b/IPython/html/static/texteditor/js/editor.js
index 6861819..48e2e88 100644
--- a/IPython/html/static/texteditor/js/editor.js
+++ b/IPython/html/static/texteditor/js/editor.js
@@ -21,6 +21,11 @@ function($,
this.codemirror = CodeMirror($(this.selector)[0]);
+ // It appears we have to set commands on the CodeMirror class, not the
+ // instance. I'd like to be wrong, but since there should only be one CM
+ // instance on the page, this is good enough for now.
+ CodeMirror.commands.save = $.proxy(this.save, this);
+
this.save_enabled = false;
};
@@ -46,9 +51,6 @@ function($,
that.save_enabled = false;
}
);
- cm.setOption("extraKeys", {
- "Ctrl-S": $.proxy(this.save, this),
- });
};
Editor.prototype.save = function() {