forked from Mirrors/helix
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
678 B
Rust
26 lines
678 B
Rust
5 years ago
|
pub struct Change {
|
||
|
from: usize,
|
||
|
to: usize,
|
||
|
insert: Option<String>,
|
||
|
}
|
||
|
|
||
|
impl Change {
|
||
|
pub fn new(from: usize, to: usize, insert: Option<String>) {
|
||
|
// old_extent, new_extent, insert
|
||
|
}
|
||
|
}
|
||
|
|
||
|
pub struct Transaction {}
|
||
|
|
||
|
// ChangeSpec = Change | ChangeSet | Vec<Change>
|
||
|
// ChangeDesc as a ChangeSet without text: can't be applied, cheaper to store.
|
||
|
// ChangeSet = ChangeDesc with Text
|
||
|
pub struct ChangeSet {
|
||
|
// basically Vec<ChangeDesc> where ChangeDesc = (current len, replacement len?)
|
||
|
// (0, n>0) for insertion, (n>0, 0) for deletion, (>0, >0) for replacement
|
||
|
sections: Vec<(usize, isize)>,
|
||
|
}
|
||
|
//
|
||
|
// trait Transaction
|
||
|
// trait StrictTransaction
|