Skip to content

Commit f3ded56

Browse files
committed
Support hiding indented leading number
1 parent 4df6929 commit f3ded56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/normalize.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,10 @@ fn is_ascii_lowercase_hex(s: &str) -> bool {
457457

458458
// "10 | T: Send," -> " | T: Send,"
459459
fn hide_leading_numbers(line: &mut String) {
460-
let n = line.bytes().take_while(u8::is_ascii_digit).count();
460+
let n = line
461+
.bytes()
462+
.take_while(|b: &u8| *b == b' ' || b.is_ascii_digit())
463+
.count();
461464
for i in 0..n {
462465
line.replace_range(i..i + 1, " ");
463466
}

0 commit comments

Comments
 (0)