Skip to content

fix: Don't specialize continuations for level's with no name #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ impl Renderer {
if g == 0 {
let current_line = buffer.num_lines();
match peek {
Some(Element::Title(level))
if level.level.name != Some(None) =>
{
Some(Element::Message(_) | Element::Title(_)) => {
self.draw_col_separator_no_space(
&mut buffer,
current_line,
Expand All @@ -363,17 +361,6 @@ impl Renderer {
current_line,
max_line_num_len + 1,
),

Some(Element::Message(level))
if level.level.name != Some(None) =>
{
self.draw_col_separator_no_space(
&mut buffer,
current_line,
max_line_num_len + 1,
);
}

None if group_len > 1 => self.draw_col_separator_end(
&mut buffer,
current_line,
Expand Down Expand Up @@ -429,9 +416,7 @@ impl Renderer {
}
if g == 0
&& (matches!(section, Element::Origin(_))
|| (matches!(section, Element::Title(_)) && i == 0)
|| matches!(section, Element::Title(level) if level.level.name == Some(None))
|| matches!(section, Element::Message(level) if level.level.name == Some(None)))
|| (matches!(section, Element::Title(_)) && i == 0))
{
let current_line = buffer.num_lines();
if peek.is_none() && group_len > 1 {
Expand All @@ -440,15 +425,7 @@ impl Renderer {
current_line,
max_line_num_len + 1,
);
} else if matches!(peek, Some(Element::Title(level)) if level.level.name != Some(None))
{
self.draw_col_separator_no_space(
&mut buffer,
current_line,
max_line_num_len + 1,
);
} else if matches!(peek, Some(Element::Message(level)) if level.level.name != Some(None))
{
} else if matches!(peek, Some(Element::Message(_) | Element::Title(_))) {
self.draw_col_separator_no_space(
&mut buffer,
current_line,
Expand Down
1 change: 1 addition & 0 deletions tests/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,7 @@ LL | let s: &str = include_bytes!("file.txt"); //~ ERROR mismatched types
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `&[u8; 0]`
| |
| expected due to this
|
= expected reference `&str`
found reference `&'static [u8; 0]`
"#]];
Expand Down
Loading