Make mergeable commands (for undo history) overridable.

This commit is contained in:
Zef Hemel 2014-06-13 16:17:17 +02:00 committed by nightwing
commit 1dd41ea75d

View file

@ -211,13 +211,14 @@ var Editor = function(renderer, session) {
}
};
// TODO use property on commands instead of this
this.$mergeableCommands = ["backspace", "del", "insertstring"];
this.$historyTracker = function(e) {
if (!this.$mergeUndoDeltas)
return;
var prev = this.prevOp;
var mergeableCommands = ["backspace", "del", "insertstring"];
var mergeableCommands = this.$mergeableCommands;
// previous command was the same
var shouldMerge = prev.command && (e.command.name == prev.command.name);
if (e.command.name == "insertstring") {