diff --git a/source/simpleswitcher.c b/source/simpleswitcher.c index 0217d433..90cfde00 100644 --- a/source/simpleswitcher.c +++ b/source/simpleswitcher.c @@ -980,13 +980,13 @@ int menu( char **lines, char **input, char *prompt, int selected, Time *time, in else // Up or Shift-Tab - if ( key == XK_Up || ( key == XK_Tab && ev.xkey.state & ShiftMask ) ) + if ( key == XK_Up || ( key == XK_Tab && ev.xkey.state & ShiftMask ) ) { selected = selected ? MAX( 0, selected-1 ): MAX( 0, filtered_lines-1 ); - - else - - // Down or Tab - if ( key == XK_Down || key == XK_Tab ) { + } + else if ( key == XK_Down ) { + selected = selected < filtered_lines-1 ? MIN( filtered_lines-1, selected+1 ): 0; + } + else if ( key == XK_Tab ) { if ( filtered_lines == 1 ) { chosen = 1; break;