From 634e91bdace3946ed6959491b0ed46e35d877f76 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 20 Apr 2026 17:12:32 +0200 Subject: [PATCH] editor: Enable diagnostics underlines in split editors (#54295) Release Notes: - Enabled diagnostic underlining in the split editor views --- crates/editor/src/split.rs | 2 +- crates/multi_buffer/src/multi_buffer.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/editor/src/split.rs b/crates/editor/src/split.rs index ee15583072144ca170328988ebec9959b391dbf1..b613f28df95dd05181173f14986c1040ac7c8d7d 100644 --- a/crates/editor/src/split.rs +++ b/crates/editor/src/split.rs @@ -483,7 +483,7 @@ impl SplittableEditor { Editor::for_multibuffer(rhs_multibuffer.clone(), Some(project.clone()), window, cx); editor.set_expand_all_diff_hunks(cx); editor.disable_runnables(); - editor.disable_diagnostics(cx); + editor.disable_inline_diagnostics(); editor.set_minimap_visibility(crate::MinimapVisibility::Disabled, window, cx); editor }); diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index 724f659e44e8153a9ef5b1a01b6b66529ab3a3e2..16d748dc3d9d6fc12d690f80bf317694986fffcf 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -5264,12 +5264,11 @@ impl MultiBufferSnapshot { /// Creates a multibuffer anchor for the given buffer anchor, if it is contained in any excerpt. pub fn anchor_in_excerpt(&self, text_anchor: text::Anchor) -> Option { - for excerpt in { - let this = &self; + let excerpts = { let buffer_id = text_anchor.buffer_id; - if let Some(buffer_state) = this.buffers.get(&buffer_id) { + if let Some(buffer_state) = self.buffers.get(&buffer_id) { let path_key = buffer_state.path_key.clone(); - let mut cursor = this.excerpts.cursor::(()); + let mut cursor = self.excerpts.cursor::(()); cursor.seek_forward(&path_key, Bias::Left); Some(iter::from_fn(move || { let excerpt = cursor.item()?; @@ -5284,7 +5283,8 @@ impl MultiBufferSnapshot { } .into_iter() .flatten() - } { + }; + for excerpt in excerpts { let buffer_snapshot = excerpt.buffer_snapshot(self); if excerpt.range.contains(&text_anchor, &buffer_snapshot) { return Some(Anchor::in_buffer(excerpt.path_key_index, text_anchor));