Permalink
Browse files

Added "historyAdded" doc event.

Added a doc event "historyAdded" which is dispatched when a new entry is added to the document history. It is not dispatched when a history entry is amended. This allows CM's history to be integrated easily into application level undo/redo.

Signed-off-by: Grant Skinner <info@gskinner.com>
  • Loading branch information...
gskinner authored and marijnh committed Jan 25, 2014
1 parent ccd334c commit c7e4ad741dbfc62ab2e4394c1945cd048f99a727
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/codemirror.js
View
@@ -5329,6 +5329,8 @@ window.CodeMirror = (function() {
hist.lastTime = time;
hist.lastOp = opId;
hist.lastOrigin = change.origin;
+
+ if (!last) { signal(doc, "historyAdded"); }
}
function removeClearedSpans(spans) {

0 comments on commit c7e4ad7

Please sign in to comment.