From 1dd41ea75dfa90d2eed246659c7638efc91d7ae2 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 13 Jun 2014 16:17:17 +0200 Subject: [PATCH] Make mergeable commands (for undo history) overridable. --- lib/ace/editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 7552a17a..6a68e5de 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -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") {