From e56baecc1edea4a461af52842cc322a9fef6c567 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Fri, 7 Mar 2025 17:54:15 -0300 Subject: [PATCH] fix(table): disable table content wrap --- ansi/table.go | 2 +- ansi/testdata/TestRendererIssues/44.golden | 16 +++-------- ansi/testdata/TestRendererIssues/46_2.golden | 28 ++++++-------------- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/ansi/table.go b/ansi/table.go index db50d9ea..f4eedd50 100644 --- a/ansi/table.go +++ b/ansi/table.go @@ -55,7 +55,7 @@ func (e *TableElement) Render(w io.Writer, ctx RenderContext) error { renderText(iw, ctx.options.ColorProfile, bs.Current().Style.StylePrimitive, rules.BlockPrefix) renderText(iw, ctx.options.ColorProfile, style, rules.Prefix) width := int(ctx.blockStack.Width(ctx)) //nolint: gosec - ctx.table.lipgloss = table.New().Width(width) + ctx.table.lipgloss = table.New().Width(width).Wrap(false) return nil } diff --git a/ansi/testdata/TestRendererIssues/44.golden b/ansi/testdata/TestRendererIssues/44.golden index 829d669d..50c85b87 100644 --- a/ansi/testdata/TestRendererIssues/44.golden +++ b/ansi/testdata/TestRendererIssues/44.golden @@ -2,16 +2,8 @@                                                                               Distributionβ”‚Architectures β”‚Package    ────────────┼──────────────────────────────┼──────────────────────────────   - Debian β”‚ amd64 ,  arm64 ,  armel ,  i3β”‚ deb  https://github.com/twpay   - β”‚ β”‚    - β”‚ β”‚    - RedHat β”‚ aarch64 ,  armhfp ,  i686 ,  β”‚ rpm  https://github.com/twpay   - β”‚ β”‚    - β”‚ β”‚    - OpenSUSE β”‚ aarch64 ,  armhfp ,  i686 ,  β”‚ rpm  https://github.com/twpay   - β”‚ β”‚    - β”‚ β”‚    - Ubuntu β”‚ amd64 ,  arm64 ,  armel ,  i3β”‚ deb  https://github.com/twpay   - β”‚ β”‚    - β”‚ β”‚    + Debian β”‚ amd64 ,  arm64 ,  armel ,  i…β”‚ deb  https://github.com/twpa…   + RedHat β”‚ aarch64 ,  armhfp ,  i686 , …β”‚ rpm  https://github.com/twpa…   + OpenSUSE β”‚ aarch64 ,  armhfp ,  i686 , …β”‚ rpm  https://github.com/twpa…   + Ubuntu β”‚ amd64 ,  arm64 ,  armel ,  i…β”‚ deb  https://github.com/twpa…   diff --git a/ansi/testdata/TestRendererIssues/46_2.golden b/ansi/testdata/TestRendererIssues/46_2.golden index 3eb1bd65..024a49b1 100644 --- a/ansi/testdata/TestRendererIssues/46_2.golden +++ b/ansi/testdata/TestRendererIssues/46_2.golden @@ -2,25 +2,13 @@                                                                               Dependency β”‚Installat…β”‚Operation    ─────────────────────────────────────┼──────────┼─────────────────────────   - xdg-open (Linux), open(1) (macOS), cyβ”‚base β”‚desktop opener    - β”‚ β”‚    - file, coreutils (cp, mv, rm), xargs β”‚base β”‚file type, copy, move and   - β”‚ β”‚    - tar, (un)zip [atool/bsdtar for more fβ”‚base β”‚create, list, extract tar   - β”‚ β”‚    + xdg-open (Linux), open(1) (macOS), c…β”‚base β”‚desktop opener    + file, coreutils (cp, mv, rm), xargs β”‚base β”‚file type, copy, move an…   + tar, (un)zip [atool/bsdtar for more …β”‚base β”‚create, list, extract ta…    archivemount, fusermount(3) β”‚optional β”‚mount, unmount archives    - sshfs, rclone https://rclone.org/, fuβ”‚optional β”‚mount, unmount remotes    - β”‚ β”‚    - trash-cli β”‚optional β”‚trash files (default acti   - β”‚ β”‚    - vlock (Linux), bashlock (macOS), lockβ”‚optional β”‚terminal locker (fallback   - β”‚ β”‚    - β”‚ β”‚    - β”‚ β”‚    - advcpmv (Linux) (integration https://β”‚optional β”‚copy, move progress    - β”‚ β”‚    - β”‚ β”‚    -  $VISUAL  (else  $EDITOR ),  $PAGER ,β”‚optional β”‚fallback vi, less, sh    - β”‚ β”‚    -    + sshfs, rclone https://rclone.org/, f…β”‚optional β”‚mount, unmount remotes    + trash-cli β”‚optional β”‚trash files (default act…   + vlock (Linux), bashlock (macOS), loc…β”‚optional β”‚terminal locker (fallbac…   + advcpmv (Linux) (integration https:/…β”‚optional β”‚copy, move progress    +  $VISUAL  (else  $EDITOR ),  $PAGER …β”‚optional β”‚fallback vi, less, sh