Merge pull request #7046 from quantopian/fix-history-undo-load

BUG: Prevent users from undoing the initial document load with CTRL-Z.
This commit is contained in:
Matthias Bussonnier 2014-11-28 11:33:46 +01:00
commit d8a90257de

View File

@ -35,7 +35,11 @@ function($,
this.contents.get(this.file_path, {type: 'file', format: 'text'})
.then(function(model) {
cm.setValue(model.content);
// Setting the file's initial value creates a history entry,
// which we don't want.
cm.clearHistory();
// Find and load the highlighting mode
var modeinfo = CodeMirror.findModeByMIME(model.mimetype);
if (modeinfo) {