Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2132 from TomMalbran/tom/batch-operation
Browse files Browse the repository at this point in the history
Fix Document.batchOperation() to guarantee a single monolithic Undo step
  • Loading branch information
peterflynn committed Nov 16, 2012
2 parents f7c176b + a220fff commit d0c5712
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/document/DocumentManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,11 @@ define(function (require, exports, module) {
*/
Document.prototype.batchOperation = function (doOperation) {
this._ensureMasterEditor();
this._masterEditor._codeMirror.operation(doOperation);

var self = this;
this._masterEditor._codeMirror.compoundChange(function () {
self._masterEditor._codeMirror.operation(doOperation);
});
};

/**
Expand Down

0 comments on commit d0c5712

Please sign in to comment.