aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/document.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 0d86143b..ce5df8ee 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -918,6 +918,9 @@ impl Document {
pub fn set_diagnostics(&mut self, diagnostics: Vec<Diagnostic>) {
self.diagnostics = diagnostics;
+ // sort by range
+ self.diagnostics
+ .sort_unstable_by_key(|diagnostic| diagnostic.range);
}
}