Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra newlines when using JoinVertical - Regression between v10 and v11 #317

Open
kalensk opened this issue Jun 11, 2024 · 0 comments
Open
Labels

Comments

@kalensk
Copy link

kalensk commented Jun 11, 2024

Describe the bug
Extra newlines are added between every line appearing as if the text was double spaced when using lipgloss.JoinVertical(). It only appears to occur on subsequent renders/calls. This is a v11 regression as the issue does not occur appear v10.

Possibly related to #199

Setup
Please complete the following information along with version numbers, if applicable.

  • OS [Ubuntu 22.04]
  • Shell [Bash]
  • Terminal Emulator: [None]
  • Terminal Multiplexer [None]
  • Locale [en_US.UTF-8]

To Reproduce
Steps to reproduce the behavior:

top := `I am top text
there is a lot in my header to show.`

middle := "I am in the middle with some bullets
- one
- two
- three"

bottom := "bottom text
with a fotter"

lipgloss.JoinVertical(lipgloss.Left, top, middle, bottom)

In v10 this example renders as expected, but in v11 it renders with double spacing which is unexpected and a bug.

The issue could be in github.com/charmbracelet/x/ansi with the switch from ansi.PrintableRuneWidth() to ansi.StringWidth()

Note the issue appears to only occurs on subsequent calls/renders, so I wonder if its a copy() related issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants