Skip to content

Commit

Permalink
misc change
Browse files Browse the repository at this point in the history
  • Loading branch information
dwreeves committed Oct 6, 2023
1 parent 74c4b4f commit 57f7e12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rich_click/rich_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ def __init__(

def make_formatter(self):
"""Create the Rich Help Formatter."""
return self.formatter_class(config=self.help_config)
return self.formatter_class(
width=self.terminal_width, max_width=self.max_content_width, config=self.help_config
)
4 changes: 4 additions & 0 deletions src/rich_click/rich_help_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def __init__(
config: Configuration.
Defaults to None.
"""
if config is not None:
# Rich config overrides width and max width if set.
width = config.width or width
max_width = config.max_width or max_width
super().__init__(indent_increment, width, max_width, *args, **kwargs)
self._rich_buffer = TerminalBuffer()
self._config = config or get_module_config()
Expand Down

0 comments on commit 57f7e12

Please sign in to comment.