mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 07:04:53 +00:00
Fix handling of newlines in empty files (#7473)
This commit is contained in:
parent
b66bfa6570
commit
0346e781d4
12 changed files with 90 additions and 15 deletions
|
@ -124,7 +124,7 @@ impl<'a> Printer<'a> {
|
|||
self.flush_line_suffixes(queue, stack, Some(element));
|
||||
} else {
|
||||
// Only print a newline if the current line isn't already empty
|
||||
if self.state.line_width > 0 || self.state.buffer.is_empty() {
|
||||
if self.state.line_width > 0 {
|
||||
self.print_char('\n');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue