From 8d39a81aa88a813c6a3e1734e5cb3c05fd723839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 26 Jun 2023 22:20:20 +0900 Subject: [PATCH] fix: Regression from d491e234f4eb4d8c3869f44ab71fedf022dc463e --- helix-view/src/document.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 4140c105..afcd3bff 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1136,6 +1136,9 @@ impl Document { diagnostic.line = self.text.char_to_line(diagnostic.range.start); } + self.diagnostics + .sort_unstable_by_key(|diagnostic| diagnostic.range); + // Update the inlay hint annotations' positions, helping ensure they are displayed in the proper place let apply_inlay_hint_changes = |annotations: &mut Rc<[InlineAnnotation]>| { if let Some(data) = Rc::get_mut(annotations) {