]> git.madduck.net Git - etc/vim.git/blobdiff - black.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

[#154] Handle comments between decorators properly (#166)
[etc/vim.git] / black.py
index 15a754742cc2212656d324fab4422ddad6982289..a03b9aad7607ffd4107b22b6382b6a00028d204c 100644 (file)
--- a/black.py
+++ b/black.py
@@ -1044,6 +1044,10 @@ class EmptyLineTracker:
                 # Don't insert empty lines between decorators.
                 return 0, 0
 
                 # Don't insert empty lines between decorators.
                 return 0, 0
 
+            if is_decorator and self.previous_line and self.previous_line.is_comment:
+                # Don't insert empty lines between decorator comments.
+                return 0, 0
+
             newlines = 2
             if current_line.depth:
                 newlines -= 1
             newlines = 2
             if current_line.depth:
                 newlines -= 1