vendor/assets/javascripts/codemirror/utils/search.js in codemirror-rails-2.23 vs vendor/assets/javascripts/codemirror/utils/search.js in codemirror-rails-2.24

- old
+ new

@@ -70,17 +70,17 @@ dialog(cm, replaceQueryDialog, "Replace:", function(query) { if (!query) return; query = parseQuery(query); dialog(cm, replacementQueryDialog, "Replace with:", function(text) { if (all) { - cm.operation(function() { + cm.compoundChange(function() { cm.operation(function() { for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { if (typeof query != "string") { var match = cm.getRange(cursor.from(), cursor.to()).match(query); cursor.replace(text.replace(/\$(\d)/, function(w, i) {return match[i];})); } else cursor.replace(text); } - }); + })}); } else { clearSearch(cm); var cursor = cm.getSearchCursor(query, cm.getCursor()); function advance() { var start = cursor.from(), match;