Skip to content

Commit 5cd6f5d

Browse files
authored
Merge pull request #257 from Muscraft/no-special
fix: Don't specialize continuations for level's with no name
2 parents d0dc6ba + 195ca86 commit 5cd6f5d

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

src/renderer/mod.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,7 @@ impl Renderer {
348348
if g == 0 {
349349
let current_line = buffer.num_lines();
350350
match peek {
351-
Some(Element::Title(level))
352-
if level.level.name != Some(None) =>
353-
{
351+
Some(Element::Message(_) | Element::Title(_)) => {
354352
self.draw_col_separator_no_space(
355353
&mut buffer,
356354
current_line,
@@ -363,17 +361,6 @@ impl Renderer {
363361
current_line,
364362
max_line_num_len + 1,
365363
),
366-
367-
Some(Element::Message(level))
368-
if level.level.name != Some(None) =>
369-
{
370-
self.draw_col_separator_no_space(
371-
&mut buffer,
372-
current_line,
373-
max_line_num_len + 1,
374-
);
375-
}
376-
377364
None if group_len > 1 => self.draw_col_separator_end(
378365
&mut buffer,
379366
current_line,
@@ -429,9 +416,7 @@ impl Renderer {
429416
}
430417
if g == 0
431418
&& (matches!(section, Element::Origin(_))
432-
|| (matches!(section, Element::Title(_)) && i == 0)
433-
|| matches!(section, Element::Title(level) if level.level.name == Some(None))
434-
|| matches!(section, Element::Message(level) if level.level.name == Some(None)))
419+
|| (matches!(section, Element::Title(_)) && i == 0))
435420
{
436421
let current_line = buffer.num_lines();
437422
if peek.is_none() && group_len > 1 {
@@ -440,15 +425,7 @@ impl Renderer {
440425
current_line,
441426
max_line_num_len + 1,
442427
);
443-
} else if matches!(peek, Some(Element::Title(level)) if level.level.name != Some(None))
444-
{
445-
self.draw_col_separator_no_space(
446-
&mut buffer,
447-
current_line,
448-
max_line_num_len + 1,
449-
);
450-
} else if matches!(peek, Some(Element::Message(level)) if level.level.name != Some(None))
451-
{
428+
} else if matches!(peek, Some(Element::Message(_) | Element::Title(_))) {
452429
self.draw_col_separator_no_space(
453430
&mut buffer,
454431
current_line,

tests/formatter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,6 +2414,7 @@ LL | let s: &str = include_bytes!("file.txt"); //~ ERROR mismatched types
24142414
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `&[u8; 0]`
24152415
| |
24162416
| expected due to this
2417+
|
24172418
= expected reference `&str`
24182419
found reference `&'static [u8; 0]`
24192420
"#]];

0 commit comments

Comments
 (0)