X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/18c17bea757dc88d0b6d2be6e99a4ebcc18e288c..4f0532d6f0d030799223453195069a282e111c8b:/src/black/linegen.py diff --git a/src/black/linegen.py b/src/black/linegen.py index ff54e05..20f3ac6 100644 --- a/src/black/linegen.py +++ b/src/black/linegen.py @@ -330,13 +330,14 @@ class LineGenerator(Visitor[Line]): # We could enforce triple quotes at this point. quote = quote_char * quote_len - if Preview.long_docstring_quotes_on_newline in self.mode: + # It's invalid to put closing single-character quotes on a new line. + if Preview.long_docstring_quotes_on_newline in self.mode and quote_len == 3: # We need to find the length of the last line of the docstring # to find if we can add the closing quotes to the line without # exceeding the maximum line length. # If docstring is one line, then we need to add the length - # of the indent, prefix, and starting quotes. Ending quote are - # handled later + # of the indent, prefix, and starting quotes. Ending quotes are + # handled later. lines = docstring.splitlines() last_line_length = len(lines[-1]) if docstring else 0