erikgeiser / promptkit

Go prompt library
MIT License
249 stars 21 forks source link

Fix for display of choices larger than the current window. #19

Closed nemith closed 1 year ago

nemith commented 1 year ago

Fix for display of choices larger than the current window.

It seems that the initial window height was not being taken in account during init and the choices were set to all choices and they overflowed giving a seemingly bad list until a filter was applied or the window was resized.

This calls m.forceUpdatePageSizeForHeight() on the model Init() which inits m.currentChoices and m.availableChoices correctly.

Fixes: #18

nemith commented 1 year ago

This isn't right. I think this is a race condition but i can't determine where just yet.