gyscos / cursive

A Text User Interface library for the Rust programming language
MIT License
4.26k stars 243 forks source link

tentatively fixes #776 #798

Closed correabuscar closed 3 months ago

correabuscar commented 3 months ago

or perhaps there's a better/different way?

776

gyscos commented 3 months ago

I think we could exit early from these functions if we notice at the start that self.children.is_empty() - there is no need to scroll, and there is no event we could react to.

correabuscar commented 3 months ago

I think I avoided early exit via 'if' check to avoid paying the check for every normal non-empty case, which should be most of the cases. At least, that's what I told myself at the time :)

feels kinda hacky either way, maybe I wait for someone else to do it better