Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Make diagnostics with empty messages take up one line (#7456)

Max Brunsfeld4e519e3af7e7
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index ad4ebd2655e..4cbd8965df7 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -7907,7 +7907,7 @@ impl Editor {
.insert_blocks(
diagnostic_group.iter().map(|entry| {
let diagnostic = entry.diagnostic.clone();
- let message_height = diagnostic.message.lines().count() as u8;
+ let message_height = diagnostic.message.matches('\n').count() as u8 + 1;
BlockProperties {
style: BlockStyle::Fixed,
position: buffer.anchor_after(entry.range.start),