mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #35731 from overleaf/mg-historyot-delete-at-end
Fix History OT base length when a tracked delete is in the document GitOrigin-RevId: 414349aedd498c2635bb3067388dcc7291e32ee6
This commit is contained in:
@@ -251,8 +251,11 @@ const updateSender = EditorState.transactionExtender.of(tr => {
|
||||
const trackingUserId = tr.startState.field(trackChangesUserIdState)
|
||||
const trackedDeletes = trackedDeletesFromState(tr.startState)
|
||||
const startDoc = tr.startState.doc
|
||||
// Seed the builder with the full snapshot length (visible length plus all
|
||||
// tracked deletes). Mapping the CM length through toSnapshot under-counts
|
||||
// when a tracked delete sits at the end of the document.
|
||||
const opBuilder = new OperationBuilder(
|
||||
trackedDeletes.toSnapshot(startDoc.length)
|
||||
startDoc.length + trackedDeletes.totalLength
|
||||
)
|
||||
|
||||
if (trackingUserId == null) {
|
||||
|
||||
Reference in New Issue
Block a user