Determine Buffer::is_dirty based on the rope's fingerprint

This commit is contained in:
Antonio Scandurra
2022-06-17 12:38:25 +02:00
parent c31a233aad
commit 6f7a893ec9
9 changed files with 127 additions and 43 deletions
+7 -1
View File
@@ -2,7 +2,7 @@ use crate::PointUtf16;
use super::Point;
use arrayvec::ArrayString;
use bromberg_sl2::HashMatrix;
use bromberg_sl2::{DigestString, HashMatrix};
use smallvec::SmallVec;
use std::{cmp, fmt, io, mem, ops::Range, str};
use sum_tree::{Bias, Dimension, SumTree};
@@ -729,6 +729,12 @@ pub struct TextSummary {
pub fingerprint: HashMatrix,
}
impl TextSummary {
pub fn hex_fingerprint(&self) -> String {
self.fingerprint.to_hex()
}
}
impl<'a> From<&'a str> for TextSummary {
fn from(text: &'a str) -> Self {
let mut lines = Point::new(0, 0);