Move Side to EditedText from Operation

This commit is contained in:
Andras Schmelczer 2025-10-26 20:23:22 +00:00
commit de89532880

View file

@ -3,13 +3,10 @@ mod operation;
mod utils;
use std::fmt::Debug;
pub use edited_text::EditedText;
pub use edited_text::{ChangeSet, EditedText};
pub use operation::Operation;
use crate::{
Tokenizer,
types::{side::Side, text_with_cursors::TextWithCursors},
};
use crate::{Tokenizer, types::text_with_cursors::TextWithCursors};
/// Given an `original` document and two concurrent edits to it,
/// return a document containing all changes from both `left`
@ -48,10 +45,8 @@ pub fn reconcile<'a, T>(
where
T: PartialEq + Clone + Debug,
{
let left_operations =
EditedText::from_strings_with_tokenizer(original, left, tokenizer, Side::Left);
let right_operations =
EditedText::from_strings_with_tokenizer(original, right, tokenizer, Side::Right);
let left_operations = EditedText::from_strings_with_tokenizer(original, left, tokenizer);
let right_operations = EditedText::from_strings_with_tokenizer(original, right, tokenizer);
left_operations.merge(right_operations)
}