Skip to content

Commit 6699650

Browse files
author
Zibi Braniecki
committed
Fix inline_marks alignment
1 parent ea74458 commit 6699650

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl DisplayListFormatting for Formatter {
1818

1919
fn format_inline_marks(inline_marks: &[DisplayMark], inline_marks_width: usize) -> String {
2020
format!(
21-
" {:>width$}",
21+
"{:>width$}",
2222
inline_marks
2323
.iter()
2424
.map(|mark| {
@@ -215,7 +215,7 @@ impl fmt::Display for DisplayList {
215215
DisplayLine::Source { inline_marks, .. } => {
216216
let width = inline_marks.len();
217217
if width > max {
218-
width
218+
width + 1
219219
} else {
220220
max
221221
}

src/format_color.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ impl DisplayListFormatting for Formatter {
2323

2424
fn format_inline_marks(inline_marks: &[DisplayMark], inline_marks_width: usize) -> String {
2525
format!(
26-
" {:>width$}",
26+
"{}{}",
27+
" ".repeat(inline_marks_width - inline_marks.len()),
2728
inline_marks
2829
.iter()
2930
.map(|mark| {
@@ -42,7 +43,6 @@ impl DisplayListFormatting for Formatter {
4243
})
4344
.collect::<Vec<String>>()
4445
.join(""),
45-
width = inline_marks_width
4646
)
4747
}
4848

@@ -273,7 +273,7 @@ impl fmt::Display for DisplayList {
273273
DisplayLine::Source { inline_marks, .. } => {
274274
let width = inline_marks.len();
275275
if width > max {
276-
width
276+
width + 1
277277
} else {
278278
max
279279
}

0 commit comments

Comments
 (0)