Fix fmt_spaces indenting in the context of 3 or more newlines

This commit is contained in:
Joshua Warner 2021-11-30 08:49:46 -08:00
parent 8ab7b121eb
commit c6116ba3ca
2 changed files with 26 additions and 1 deletions

View file

@ -46,7 +46,7 @@ where
match space {
Newline => {
if !encountered_comment && (consecutive_newlines < 2) {
if iter.peek() == Some(&&Newline) {
if iter.peek() == Some(&&Newline) && consecutive_newlines < 1 {
buf.push('\n');
} else {
newline(buf, indent);