Skip to content

Unexpected artifacts from lg.JoinVertical #199

Open
@NiloCK

Description

@NiloCK

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions