mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
menu: don't alight cursor on separators
This commit is contained in:
parent
ee6eb1a37b
commit
0977fa0d56
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user