X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/29e97d1d4a7717f1bd0ca35cacf2f2ce6d815b0c..52fda8b0e9e52e94aae6cb3170c9b1b492a2d8b4:/black.py?ds=sidebyside diff --git a/black.py b/black.py index a03b9aa..11386d2 100644 --- a/black.py +++ b/black.py @@ -1040,12 +1040,14 @@ class EmptyLineTracker: # Don't insert empty lines before the first line in the file. return 0, 0 - if self.previous_line and self.previous_line.is_decorator: - # Don't insert empty lines between decorators. + if self.previous_line.is_decorator: return 0, 0 - if is_decorator and self.previous_line and self.previous_line.is_comment: - # Don't insert empty lines between decorator comments. + if ( + self.previous_line.is_comment + and self.previous_line.depth == current_line.depth + and before == 0 + ): return 0, 0 newlines = 2