prosemirror-history
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,7 @@ | ||
## 1.0.2 (2018-03-13) | ||
### Bug fixes | ||
Fix a bug that could corrupt the history when rebasing changes because of collaborative editing. | ||
## 1.0.1 (2018-03-05) | ||
@@ -2,0 +8,0 @@ |
@@ -152,2 +152,3 @@ 'use strict'; | ||
var eventCount = this.eventCount; | ||
this.items.forEach(function (item) { if (item.selection) { eventCount--; } }, this.items.length - rebasedCount); | ||
@@ -163,5 +164,5 @@ var iRebased = rebasedCount; | ||
var selection = item.selection && item.selection.map(mapping.slice(iRebased, pos)); | ||
if (selection) { eventCount++; } | ||
rebasedItems.push(new Item(map, step, selection)); | ||
} else { | ||
if (item.selection) { eventCount--; } | ||
rebasedItems.push(new Item(map)); | ||
@@ -176,2 +177,3 @@ } | ||
var branch = new Branch(items, eventCount); | ||
if (branch.emptyItemCount() > max_empty_items) | ||
@@ -178,0 +180,0 @@ { branch = branch.compress(this.items.length - rebasedItems.length); } |
{ | ||
"name": "prosemirror-history", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Undo history for ProseMirror", | ||
@@ -5,0 +5,0 @@ "main": "dist/history.js", |
@@ -145,2 +145,3 @@ import RopeSequence from "rope-sequence" | ||
let eventCount = this.eventCount | ||
this.items.forEach(item => { if (item.selection) eventCount-- }, this.items.length - rebasedCount) | ||
@@ -156,5 +157,5 @@ let iRebased = rebasedCount | ||
let selection = item.selection && item.selection.map(mapping.slice(iRebased, pos)) | ||
if (selection) eventCount++ | ||
rebasedItems.push(new Item(map, step, selection)) | ||
} else { | ||
if (item.selection) eventCount-- | ||
rebasedItems.push(new Item(map)) | ||
@@ -169,2 +170,3 @@ } | ||
let branch = new Branch(items, eventCount) | ||
if (branch.emptyItemCount() > max_empty_items) | ||
@@ -171,0 +173,0 @@ branch = branch.compress(this.items.length - rebasedItems.length) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70720
769