mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
fix(tui): renderer: line wrapping in chat
This fixes an issue where the tool call in nested headers don't wrap correctly when the tool name is long. The tool name is now rendered without an extra trailing space, and the parameter list is rendered with the correct width calculation.
This commit is contained in:
@@ -124,9 +124,9 @@ func (br baseRenderer) makeNestedHeader(v *toolCallCmp, tool string, width int,
|
||||
} else if v.cancelled {
|
||||
icon = t.S().Muted.Render(styles.ToolPending)
|
||||
}
|
||||
tool = t.S().Base.Foreground(t.FgHalfMuted).Render(tool) + " "
|
||||
tool = t.S().Base.Foreground(t.FgHalfMuted).Render(tool)
|
||||
prefix := fmt.Sprintf("%s %s ", icon, tool)
|
||||
return prefix + renderParamList(true, width-lipgloss.Width(tool), params...)
|
||||
return prefix + renderParamList(true, width-lipgloss.Width(prefix), params...)
|
||||
}
|
||||
|
||||
// makeHeader builds "<Tool>: param (key=value)" and truncates as needed.
|
||||
|
||||
Reference in New Issue
Block a user