Add padding around rendered output

This commit is contained in:
2026-04-01 23:59:34 -07:00
parent 65ff34dd2c
commit 0e7f30d6c3
2 changed files with 6 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ from dataclasses import dataclass
from rich.console import Console, RenderableType
from rich.json import JSON as RichJSON
from rich.markdown import Markdown
from rich.padding import Padding
from rich.syntax import Syntax
from rp.pager import MousePager
@@ -75,8 +76,10 @@ def render(
content, "text", theme=options.theme, line_numbers=line_numbers
)
padded = Padding(renderable, (1, 2))
if use_pager:
with console.pager(pager=MousePager(), styles=True):
console.print(renderable)
console.print(padded)
else:
console.print(renderable)
console.print(padded)

2
uv.lock generated
View File

@@ -198,7 +198,7 @@ wheels = [
[[package]]
name = "rp"
version = "0.2.1"
version = "0.2.2"
source = { editable = "." }
dependencies = [
{ name = "rich" },