The open source coding agent.
TypeScript
fix: word wrapping with hyphens
adamdotdevinaae354c9513c
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.goindex 1bbf3c5ca2d..2d762dfa9fa 100644--- a/packages/tui/internal/components/chat/message.go+++ b/packages/tui/internal/components/chat/message.go@@ -325,7 +325,9 @@ func renderText(// wrap styled textstyledText := result.String()- wrappedText := ansi.WordwrapWc(styledText, width-6, " -")+ styledText = strings.ReplaceAll(styledText, "-", "\u2011")+ wrappedText := ansi.WordwrapWc(styledText, width-6, " ")+ wrappedText = strings.ReplaceAll(wrappedText, "\u2011", "-")content = base.Width(width - 6).Render(wrappedText)}diff --git a/packages/tui/internal/util/file.go b/packages/tui/internal/util/file.goindex b079f24cdc4..943f784fcb0 100644--- a/packages/tui/internal/util/file.go+++ b/packages/tui/internal/util/file.go@@ -85,6 +85,7 @@ func Extension(path string) string {func ToMarkdown(content string, width int, backgroundColor compat.AdaptiveColor) string {r := styles.GetMarkdownRenderer(width-6, backgroundColor)content = strings.ReplaceAll(content, RootPath+"/", "")+ content = strings.ReplaceAll(content, "-", "\u2011")rendered, _ := r.Render(content)lines := strings.Split(rendered, "\n")@@ -105,5 +106,6 @@ func ToMarkdown(content string, width int, backgroundColor compat.AdaptiveColor)}}content = strings.Join(lines, "\n")+ content = strings.ReplaceAll(content, "\u2011", "-")return strings.TrimSuffix(content, "\n")}