Skip to content

Commit 475dca6

Browse files
committed
fix: Render Padding as end col separator if last in Group
1 parent 43ef46a commit 475dca6

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/renderer/mod.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,19 @@ impl Renderer {
413413
}
414414
Element::Padding(_) => {
415415
let current_line = buffer.num_lines();
416-
self.draw_col_separator_no_space(
417-
&mut buffer,
418-
current_line,
419-
max_line_num_len + 1,
420-
);
416+
if peek.is_none() {
417+
self.draw_col_separator_end(
418+
&mut buffer,
419+
current_line,
420+
max_line_num_len + 1,
421+
);
422+
} else {
423+
self.draw_col_separator_no_space(
424+
&mut buffer,
425+
current_line,
426+
max_line_num_len + 1,
427+
);
428+
}
421429
}
422430
}
423431
if g == 0

tests/formatter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,7 +2875,7 @@ error[E0282]: type annotations needed
28752875
28762876
LL │ .sum::<_>() //~ ERROR type annotations needed
28772877
│ ━━━ cannot infer type of the type parameter `S` declared on the method `sum`
2878-
2878+
╰╴
28792879
"#]];
28802880
let renderer = renderer.theme(OutputTheme::Unicode);
28812881
assert_data_eq!(renderer.render(input), expected_unicode);
@@ -2942,7 +2942,7 @@ error[E0282]: type annotations needed
29422942
29432943
LL │ .sum::<_>() //~ ERROR type annotations needed
29442944
│ ━━━ cannot infer type of the type parameter `S` declared on the method `sum`
2945-
2945+
╰╴
29462946
help: consider specifying the generic argument
29472947
╭╴
29482948
LL - .sum::<_>() //~ ERROR type annotations needed

0 commit comments

Comments
 (0)