mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
Make pushReplace([], []) do nothing
Change-Id: Ifa8df99f376ce22add9d06e76831e8b661e6ddbf
This commit is contained in:
parent
2439c0149a
commit
d39fb9dd1c
|
@ -262,6 +262,10 @@ ve.dm.Transaction.prototype.pushRetain = function( length ) {
|
|||
* @param {Array] insert Data to replace 'remove' with
|
||||
*/
|
||||
ve.dm.Transaction.prototype.pushReplace = function( remove, insert ) {
|
||||
if ( remove.length === 0 && insert.length === 0 ) {
|
||||
// Don't push no-ops
|
||||
return;
|
||||
}
|
||||
this.operations.push( {
|
||||
'type': 'replace',
|
||||
'remove': remove,
|
||||
|
|
Loading…
Reference in a new issue