charmbracelet / charmbracelet/bubbles
Viewport ScrollPercent() sometimes returns `NaN`
Open
- Dominant language
- Go
- Stars
- 8.9k
- Forks
- 457
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 5
Description
if `y.Offset` = 0 and the terminal window size is **almost large enough** to contain all of the content in the viewport, `ScrollPercent()` will return `NaN`.
If the `m.Height >= len(m.lines)` your already returning 1.0 which works great, maybe it should be len(m.lines - 1) because you also have `t := float64(len(m.lines) - 1)`? Not sure yet, I haven't debugged it yet, but you can see it here in the default bubbletea/examples/pager`.

Contributor guide
Assessment
This issue has not been assessed yet.