Skip to content

Commit 606f55f

Browse files
committed
Wrap replaceSelections in an operation
Issue #2485
1 parent ef22935 commit 606f55f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/codemirror.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6254,13 +6254,13 @@
62546254
}
62556255
return parts;
62566256
},
6257-
replaceSelection: docMethodOp(function(code, collapse, origin) {
6257+
replaceSelection: function(code, collapse, origin) {
62586258
var dup = [];
62596259
for (var i = 0; i < this.sel.ranges.length; i++)
62606260
dup[i] = code;
62616261
this.replaceSelections(dup, collapse, origin || "+input");
6262-
}),
6263-
replaceSelections: function(code, collapse, origin) {
6262+
},
6263+
replaceSelections: docMethodOp(function(code, collapse, origin) {
62646264
var changes = [], sel = this.sel;
62656265
for (var i = 0; i < sel.ranges.length; i++) {
62666266
var range = sel.ranges[i];
@@ -6271,7 +6271,7 @@
62716271
makeChange(this, changes[i]);
62726272
if (newSel) setSelectionReplaceHistory(this, newSel);
62736273
else if (this.cm) ensureCursorVisible(this.cm);
6274-
},
6274+
}),
62756275
undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}),
62766276
redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}),
62776277
undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}),

0 commit comments

Comments
 (0)