bubbles
bubbles copied to clipboard
fix(viewport): preempt potential panics when calculating visible lines
This adds some checks to prevent slice out-of-bounds errors when calculating visible lines in the viewport.
This will fix the panic we're seeing in https://github.com/charmbracelet/gum/issues/660#issuecomment-2323328662 (though we still need to address the zero-height-by-default thing).