diff --git a/dmenu.c b/dmenu.c index 7361377..fcec79b 100644 --- a/dmenu.c +++ b/dmenu.c @@ -479,6 +502,27 @@ insert: sel->out = 1; break; case XK_Right: + if (columns > 1) { + if (!sel) + return; + tmpsel = sel; + for (i = 0; i < lines; i++) { + if (!tmpsel->right || tmpsel->right->left != tmpsel) { + if (offscreen) + break; + return; + } + tmpsel = tmpsel->right; + if (tmpsel == next) + offscreen = 1; + } + sel = tmpsel; + if (offscreen) { + curr = next; + calcoffsets(); + } + break; + } if (text[cursor] != '\0') { cursor = nextrune(+1); break;