Fix up merge

This commit is contained in:
Jelle Zijlstra 2023-12-09 19:37:47 -08:00
parent 37f8ed0a3f
commit be46470e55

View File

@ -681,14 +681,17 @@ def _maybe_empty_lines(self, current_line: Line) -> Tuple[int, int]:
# In preview mode, always allow blank lines, except right before a function # In preview mode, always allow blank lines, except right before a function
# docstring # docstring
is_empty_first_line_ok = ( is_empty_first_line_ok = not is_docstring(current_line.leaves[0]) or (
not is_docstring(current_line.leaves[0])
or (
self.previous_line self.previous_line
and self.previous_line.leaves[0] and self.previous_line.leaves[0]
and self.previous_line.leaves[0].parent and self.previous_line.leaves[0].parent
and not is_funcdef(self.previous_line.leaves[0].parent) and not is_funcdef(self.previous_line.leaves[0].parent)
) )
if (
self.previous_line
and self.previous_line.opens_block
and not is_empty_first_line_ok
): ):
return 0, 0 return 0, 0
return before, 0 return before, 0