diff --git a/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap b/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap index 246b2fe..cd775b2 100644 --- a/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap +++ b/src/operation_transformation/snapshots/reconcile__operation_transformation__edited_text__tests__calculate_operations.snap @@ -1,5 +1,5 @@ --- -source: reconcile/src/operation_transformation/edited_text.rs +source: src/operation_transformation/edited_text.rs expression: operations snapshot_kind: text --- @@ -8,11 +8,11 @@ EditedText { operations: [ OrderedOperation { order: 0, - operation: , + operation: , }, OrderedOperation { - order: 0, - operation: , + order: 12, + operation: , }, OrderedOperation { order: 12, @@ -32,11 +32,11 @@ EditedText { }, OrderedOperation { order: 20, - operation: , + operation: , }, OrderedOperation { - order: 20, - operation: , + order: 31, + operation: , }, ], cursors: [], diff --git a/src/operation_transformation/utils/elongate_operations.rs b/src/operation_transformation/utils/elongate_operations.rs index 9883791..212ba7e 100644 --- a/src/operation_transformation/utils/elongate_operations.rs +++ b/src/operation_transformation/utils/elongate_operations.rs @@ -41,20 +41,20 @@ where } }, RawOperation::Equal(..) => Box::new( - maybe_previous_insert + maybe_previous_delete .take() .into_iter() - .chain(maybe_previous_delete.take()) + .chain(maybe_previous_insert.take()) .chain(iter::once(next)), ) as Box>>, }) .collect(); - if let Some(prev) = maybe_previous_insert { + if let Some(prev) = maybe_previous_delete { result.push(prev); } - if let Some(prev) = maybe_previous_delete { + if let Some(prev) = maybe_previous_insert { result.push(prev); }