dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.6k stars 112 forks source link

moving within a menu section with all disabled items hits an infinite loop #2606

Closed dankamongmen closed 2 years ago

dankamongmen commented 2 years ago

If a menu section is created with entiretly disabled items, it can be opened, but then pressing up or down within that menu leads to the application locking up, pegging a cpu.

dankamongmen commented 2 years ago

heh, from ncmenu_previtem():

  // FIXME probably best to detect cycles 

indeed, nicholas, indeed!

dankamongmen commented 2 years ago

We now detect cycles in both ncmenu_previtem() and ncmenu_nextitem(), resolving this problem.

dankamongmen commented 2 years ago

i also now check for cycles in ncmenu_prevsection() and ncmenu_nextsection() as of f0976131e