Fix token list display
This commit is contained in:
parent
eb083c2972
commit
8e09d487c3
@ -17,12 +17,13 @@ pub fn write_token_list<W: Write>(tokens: &[(Token, Span)], styled: bool, writer
|
|||||||
|
|
||||||
for (token, position) in tokens {
|
for (token, position) in tokens {
|
||||||
let token = if styled {
|
let token = if styled {
|
||||||
format!("{:^13}", token.to_string().bold())
|
format!("{:^13}", token.as_str().bold())
|
||||||
} else {
|
} else {
|
||||||
format!("{token:^13}")
|
token.to_string()
|
||||||
};
|
};
|
||||||
|
let position = position.to_string();
|
||||||
|
|
||||||
writeln!(writer, "{token} {position:<10}").unwrap();
|
writeln!(writer, "{token:^13} {position:^10}").unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user