From 044d3eb2068e13fc6ad2fd8e50a89c7f73e454d1 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Mon, 30 Mar 2026 15:49:57 +0300 Subject: [PATCH] style: align Read tool gutter styling with Write tool - Add block-level indentation (2 spaces) to Read tool output - Configure herald CodeLineNumber style to use GutterBg background - Match Write tool's gray gutter appearance --- internal/ui/tool_renderers.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/internal/ui/tool_renderers.go b/internal/ui/tool_renderers.go index cd92195d..c22cc143 100644 --- a/internal/ui/tool_renderers.go +++ b/internal/ui/tool_renderers.go @@ -440,8 +440,19 @@ func renderReadBody(toolArgs, toolResult string, width int) string { } // Create typography with line number offset and custom formatter + // Match Write tool: GutterBg for line numbers, CodeBg for content codeContent := strings.Join(codeLines, "\n") + theme := GetTheme() + hty := herald.Theme{ + CodeBlock: lipgloss.NewStyle(). + Background(theme.CodeBg). + PaddingLeft(1), + CodeLineNumber: lipgloss.NewStyle(). + Foreground(theme.Muted). + Background(theme.GutterBg), + } ty := herald.New( + herald.WithTheme(hty), herald.WithCodeLineNumbers(true), herald.WithCodeLineNumberOffset(offset), herald.WithCodeFormatter(func(code, _ string) string { @@ -465,7 +476,13 @@ func renderReadBody(toolArgs, toolResult string, width int) string { result += "\n" + lipgloss.NewStyle().Foreground(GetTheme().Muted).Render(footer) } - return result + // Indent entire block to match Write/Edit tools (2 spaces) + const blockIndent = " " + lines := strings.Split(result, "\n") + for i, line := range lines { + lines[i] = blockIndent + line + } + return strings.Join(lines, "\n") } // ---------------------------------------------------------------------------