Introduce IndentWidth (#7301)

This commit is contained in:
Micha Reiser
2023-09-13 14:52:24 +02:00
committed by GitHub
parent e122a96d27
commit 2d9b39871f
26 changed files with 187 additions and 199 deletions

View File

@@ -353,7 +353,7 @@ impl Format<PyFormatContext<'_>> for FormatTrailingEndOfLineComment<'_> {
} else {
// Start with 2 because of the two leading spaces.
let width = 2u32.saturating_add(
TextWidth::from_text(&normalized_comment, f.options().tab_width())
TextWidth::from_text(&normalized_comment, f.options().indent_width())
.width()
.expect("Expected comment not to contain any newlines")
.value(),