Skip to content

Commit

Permalink
Invert order in which onChange and onCursorActivity are called
Browse files Browse the repository at this point in the history
(onChange goes first now)
  • Loading branch information
marijnh committed Jun 9, 2012
1 parent 95143f8 commit 3805278
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -1981,11 +1981,11 @@ var CodeMirror = (function() {
if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;}
if (posEq(sel.from, sel.to)) matchBrackets(false);
}), 20);
var tc = textChanged, cbs = callbacks; // these can be reset by callbacks
if (selectionChanged && options.onCursorActivity)
var sc = selectionChanged, cbs = callbacks; // these can be reset by callbacks
if (textChanged && options.onChange && instance)
options.onChange(instance, textChanged);
if (sc && options.onCursorActivity)
options.onCursorActivity(instance);
if (tc && options.onChange && instance)
options.onChange(instance, tc);
for (var i = 0; i < cbs.length; ++i) cbs[i](instance);
if (updated && options.onUpdate) options.onUpdate(instance);
}
Expand Down

0 comments on commit 3805278

Please sign in to comment.