Skip to content

Commit bb2ab46

Browse files
committed
fix(cli): Add "examples:" suffix to build_description headings
Change build_description to produce "{heading} examples:" format (e.g., "load examples:") instead of "{heading}:" (e.g., "load:"). The formatter's colorization logic uses content_lower.endswith("examples:") to detect example section headings. Without the "examples:" suffix, section headings like "load:" were not recognized and colorization never triggered. This aligns with vcspull's implementation which uses the same pattern.
1 parent 784f15c commit bb2ab46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tmuxp/_internal/colors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ def build_description(
850850
'My tool.\n\nexamples:\n mytool run'
851851
852852
>>> build_description("My tool.", [("sync", ["mytool sync repo"])])
853-
'My tool.\n\nsync:\n mytool sync repo'
853+
'My tool.\n\nsync examples:\n mytool sync repo'
854854
855855
>>> build_description("", [(None, ["cmd"])])
856856
'examples:\n cmd'
@@ -865,7 +865,7 @@ def build_description(
865865
for heading, commands in example_blocks:
866866
if not commands:
867867
continue
868-
title = "examples:" if heading is None else f"{heading}:"
868+
title = "examples:" if heading is None else f"{heading} examples:"
869869
lines = [title]
870870
lines.extend(f" {command}" for command in commands)
871871
sections.append("\n".join(lines))

0 commit comments

Comments
 (0)