You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello, I come from a project (ticker) that uses bubbles/viewport to display its main contents.
we noticed that when the content doesn't fit on a single page and you scroll at the bottom, bubbles/viewport doesn't render the last line of content if it doesn't end with a new line \n character (here the issue #158 reported on ticker).
$ git clone https://github.com/charmbracelet/bubbletea.git
...
$ cd bubbletea/examples/pager/
$ go build
$ ls -1
artichoke.md # file displayed in the example
main.go
pager*
$ tail -1 artichoke.md | xxd | tail -1
00000030: 2069 6e20 5370 616e 6973 682e 0a in Spanish.. # ends with new line
$ ./pager
lastline.mp4
everything looks fine, now I remove last new line \n character from artichoke.md:
_Alcachofa_, if you were wondering, is artichoke in Spanish.
is not displayed anymore.
unfortunately I don't have a patch, I suspect it's an off-by-one error because I see lots of len(m.lines)-1 in viewport.go and I think it could be related to the problem, but I wasn't able to completely figure it out.
The text was updated successfully, but these errors were encountered:
hello, I come from a project (
ticker
) that usesbubbles/viewport
to display its main contents.we noticed that when the content doesn't fit on a single page and you scroll at the bottom,
bubbles/viewport
doesn't render the last line of content if it doesn't end with a new line\n
character (here the issue #158 reported onticker
).the problem is reproducible with
bubbletea
's pager example that usesbubbles/viewport
, for example:lastline.mp4
everything looks fine, now I remove last new line
\n
character fromartichoke.md
:nolastline.mp4
and the last line
is not displayed anymore.
unfortunately I don't have a patch, I suspect it's an off-by-one error because I see lots of
len(m.lines)-1
inviewport.go
and I think it could be related to the problem, but I wasn't able to completely figure it out.The text was updated successfully, but these errors were encountered: