lipgloss icon indicating copy to clipboard operation
lipgloss copied to clipboard

Unexpected artifacts from lg.JoinVertical

Open NiloCK opened this issue 2 years ago • 1 comments

Describe the bug

JoinVertical is adding extra newLines (or otherwise something weird is happening) to the topmost passed text.

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

  • OS: Ubuntu
  • Shell ... the ubuntu shell?
  • Terminal Emulator [e.g. kitty, iterm]
  • Terminal Multiplexer: under tmux & with no multiplexer
  • Locale: unsure

To Reproduce Steps to reproduce the behavior:

git clone http://github.com/nilock/tuido
cd tuido
go run .
[press ENTER] - opens context preview on the first listed todo item]

This will display the broken text from below.

To see the same text unbroken, replace return lg.JoinVertical(lg.Left, bodyWithPointer, foot) with return bodyWithPointer on line 44 of ./tui/peek.go, and rerun the above instructions.

Source Code http://github.com/nilock/tuido

Expected behavior See screenshots.

Screenshots

Broken text:

image

The same text not joined with the footer:

image

Additional context The broken text is read at runtime from files on disk. The breaking newline behaviour only occurs when rendering .go files - the .md (eg, readme.md) file gets rendered correctly. AFAICT, both are Uni-8. I can't guess why the discrepancy, but this feels like a good clue.

Some other things are happening to this text before the JoinVertical

  • colorized with monokai
  • joined with the pointer + border on left via JoinHorizontal
  • styled with padding

... Manually removing each of these showed no effect - the described issue still presents.

NiloCK avatar May 24 '23 02:05 NiloCK

I am running into something similar https://github.com/charmbracelet/lipgloss/issues/317

kalensk avatar Jun 11 '24 23:06 kalensk