Skip to content

Commit

Permalink
Override only when max_width is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ealap authored Jun 12, 2023
1 parent 0d60334 commit 491f643
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rich_click/rich_help_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def create_console(config: RichHelpConfiguration, file: Optional[IO[str]] = None
file=file,
legacy_windows=config.legacy_windows,
)
console.width = min(config.max_width, console.size.width)
if isinstance(config.max_width, int):
console.width = min(config.max_width, console.size.width)
return console


Expand Down

0 comments on commit 491f643

Please sign in to comment.