Add LineSuffix reserved width (#6830)

Thanks for working on this.
This commit is contained in:
Chris Pryer 2023-08-28 01:46:54 -04:00 committed by GitHub
parent 6bc1ba6d62
commit 039694aaed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 111 additions and 28 deletions

View file

@ -150,10 +150,13 @@ impl Format<PyFormatContext<'_>> for FormatTrailingComments<'_> {
write!(
f,
[
line_suffix(&format_args![
empty_lines(lines_before_comment),
format_comment(trailing)
]),
line_suffix(
&format_args![
empty_lines(lines_before_comment),
format_comment(trailing)
],
0
),
expand_parent()
]
)?;
@ -161,7 +164,7 @@ impl Format<PyFormatContext<'_>> for FormatTrailingComments<'_> {
write!(
f,
[
line_suffix(&format_args![space(), space(), format_comment(trailing)]),
line_suffix(&format_args![space(), space(), format_comment(trailing)], 0),
expand_parent()
]
)?;
@ -266,7 +269,7 @@ impl Format<PyFormatContext<'_>> for FormatDanglingOpenParenthesisComments<'_> {
write!(
f,
[
line_suffix(&format_args!(space(), space(), format_comment(comment))),
line_suffix(&format_args!(space(), space(), format_comment(comment)), 0),
expand_parent()
]
)?;