menu: don't alight cursor on separators

This commit is contained in:
nick black 2020-02-03 12:33:06 -05:00
parent ee6eb1a37b
commit 0977fa0d56
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -277,9 +277,12 @@ int ncmenu_nextitem(ncmenu* n){
return -1;
}
}
// FIXME can't allow any section to be all NULLs or we'll infintitely loop
do{
if(++n->sections[n->unrolledsection].itemselected == n->sections[n->unrolledsection].itemcount){
n->sections[n->unrolledsection].itemselected = 0;
}
}while(!n->sections[n->unrolledsection].items[n->sections[n->unrolledsection].itemselected].desc);
return ncmenu_unroll(n, n->unrolledsection);
}
@ -289,9 +292,11 @@ int ncmenu_previtem(ncmenu* n){
return -1;
}
}
do{
if(n->sections[n->unrolledsection].itemselected-- == 0){
n->sections[n->unrolledsection].itemselected = n->sections[n->unrolledsection].itemcount - 1;
}
}while(!n->sections[n->unrolledsection].items[n->sections[n->unrolledsection].itemselected].desc);
return ncmenu_unroll(n, n->unrolledsection);
}