Skip to content

Commit 8305563

Browse files
committed
Updated comments.
1 parent f156b75 commit 8305563

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ def print_to(
15771577
If False, Rich wraps text to fit the terminal width.
15781578
Set this to False when printing structured Renderables like
15791579
Tables, Panels, or Columns to ensure they render as expected.
1580-
For example, when soft_wrap is True Panels truncate text
1580+
For example, when soft_wrap is True, Panels truncate text
15811581
which is wider than the terminal.
15821582
:param justify: justify method ("left", "center", "right", "full"). Defaults to None.
15831583
:param emoji: If True, Rich will replace emoji codes (e.g., :smiley:) with their

examples/async_printing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def get_alerts() -> list[tuple[Any, bool]]:
2727
table.add_row("stop_alerts", "Stop the async alert generator")
2828
table.add_row("help", "Show help menu")
2929

30+
# Set soft_wrap to False when printing structured Renderables like Tables, Panels, or Columns
31+
# to ensure they render as expected. For example, when soft_wrap is True, Panels truncate
32+
# text which is wider than the terminal.
3033
return [
3134
(Text("Watch as this application prints alerts asynchronously!", style="bold bright_cyan"), True),
3235
("Notice how alerts don't interfere with your typing or cursor location.", True),

0 commit comments

Comments
 (0)