feat: enlarge floating hover and highlight Markdown content

This commit is contained in:
2026-10-10 16:10:25 +02:00
parent 99028daa9d
commit dc0bdd60d0
5 changed files with 123 additions and 15 deletions
+12
View File
@@ -64,6 +64,18 @@ impl SyntaxCache {
Self::default()
}
pub(crate) fn update_text(&mut self, text: &str, path: &Path) {
if self.source == text && self.path.as_deref() == Some(path) {
return;
}
let lines: Vec<String> = text.split('\n').map(str::to_owned).collect();
self.update(
&lines,
Some(path),
self.revision.unwrap_or(0).wrapping_add(1),
);
}
/// `revision` must change whenever line content changes; path changes are detected separately.
pub fn update(&mut self, lines: &[String], path: Option<&Path>, revision: u64) {
let path_changed = self.path.as_deref() != path;