Move Side to EditedText from Operation
This commit is contained in:
parent
8a52034426
commit
de89532880
1 changed files with 119 additions and 55 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue