Fix loop around for number keys

This commit is contained in:
RisingThumb 2020-09-22 22:41:16 +01:00 committed by malod219
parent 2b0484b11c
commit 02511d092b

View File

@ -1282,10 +1282,11 @@ selectitem:
item = itemcycle(currmenu, ITEMNEXT); item = itemcycle(currmenu, ITEMNEXT);
} else if (ksym >= XK_1 && ksym <= XK_9){ } else if (ksym >= XK_1 && ksym <= XK_9){
item = itemcycle(currmenu, ITEMFIRST); item = itemcycle(currmenu, ITEMFIRST);
currmenu->selected = item;
for(int i = ksym-XK_1; i > 0; i-=1){ for(int i = ksym-XK_1; i > 0; i-=1){
item = itemcycle(currmenu, ITEMNEXT);
currmenu->selected = item; currmenu->selected = item;
item = itemcycle(currmenu, ITEMNEXT);
if (item == itemcycle(currmenu, ITEMLAST))
break;
} }
} else if ((ksym == XK_Return || ksym == XK_Right || ksym == KSYMRIGHT) && } else if ((ksym == XK_Return || ksym == XK_Right || ksym == KSYMRIGHT) &&
currmenu->selected != NULL) { currmenu->selected != NULL) {