Skip to content

Commit 961e069

Browse files
author
Panos
committed
identation
1 parent 1757fee commit 961e069

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

github_trending/display.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,23 @@ def _display_repo_list(self, repos: List[Dict[str, str]]):
146146
description = repo.get('description', 'No description').strip()
147147

148148
self.console.print(line)
149-
self.console.print(f" [dim]{description}[/dim]")
149+
self._print_description_with_indent(description)
150150
self.console.print()
151151

152+
def _print_description_with_indent(self, description: str):
153+
"""Print description with proper indentation for wrapped lines."""
154+
import textwrap
155+
156+
# Calculate available width (console width minus indentation)
157+
available_width = self.console.size.width - 4 # 4 spaces for indentation
158+
159+
# Wrap the text to fit within available width
160+
wrapped_lines = textwrap.wrap(description, width=available_width)
161+
162+
# Print each line with proper indentation
163+
for line in wrapped_lines:
164+
self.console.print(f" [dim]{line}[/dim]")
165+
152166

153167
def show_repository_header(self, repo: Dict[str, str]):
154168
"""Show detailed header information for a repository."""

0 commit comments

Comments
 (0)