mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-28 09:54:33 +00:00
Trim diagnostic messages to fix rendering bug
Before this change a diagnostic message with a trailing newline (e.g. `line1\nline2\n`) would be rendered in a `Block` with `line_height: 2`. But the content we then display in this block had 3 "lines", which pushed the content out of the block. This fixes the issue by trimming the newlines at the end from the diagnostics. Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
parent
5a9f1e4eb7
commit
f8939fd859
1 changed files with 2 additions and 2 deletions
|
@ -3906,7 +3906,7 @@ impl Project {
|
|||
source: diagnostic.source.clone(),
|
||||
code: code.clone(),
|
||||
severity: diagnostic.severity.unwrap_or(DiagnosticSeverity::ERROR),
|
||||
message: diagnostic.message.clone(),
|
||||
message: diagnostic.message.trim().to_string(),
|
||||
group_id,
|
||||
is_primary: true,
|
||||
is_disk_based,
|
||||
|
@ -3923,7 +3923,7 @@ impl Project {
|
|||
source: diagnostic.source.clone(),
|
||||
code: code.clone(),
|
||||
severity: DiagnosticSeverity::INFORMATION,
|
||||
message: info.message.clone(),
|
||||
message: info.message.trim().to_string(),
|
||||
group_id,
|
||||
is_primary: false,
|
||||
is_disk_based,
|
||||
|
|
Loading…
Reference in a new issue