Don't reuse excerpt ids in MultiBuffer
This prevents anchors from swapping their ordering, which was causing issues in FoldMap. Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
co-authored by
Antonio Scandurra
parent
134496ce8f
commit
5407f25c94
@@ -49,6 +49,30 @@ impl Default for Locator {
|
||||
}
|
||||
}
|
||||
|
||||
impl sum_tree::Item for Locator {
|
||||
type Summary = Locator;
|
||||
|
||||
fn summary(&self) -> Self::Summary {
|
||||
self.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl sum_tree::KeyedItem for Locator {
|
||||
type Key = Locator;
|
||||
|
||||
fn key(&self) -> Self::Key {
|
||||
self.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl sum_tree::Summary for Locator {
|
||||
type Context = ();
|
||||
|
||||
fn add_summary(&mut self, summary: &Self, _: &()) {
|
||||
self.assign(summary);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user