diff options
author | Blaž Hrastnik | 2021-11-06 09:58:40 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-11-06 09:58:58 +0000 |
commit | e80708eba7e9959fa720e2563231bba542570295 (patch) | |
tree | c5c88732d81a4ca0859a96197a319716beb1dcac /helix-view/src/document.rs | |
parent | 0f4cd73000140cd9872f291ddb1473f96cbc7364 (diff) |
Make sure document diagnostics are sorted
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r-- | helix-view/src/document.rs | 3 |
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); } } |