- drawrect(dc, textnw(dc, text, cursor) + dc->h/2 - 2, 2, 1, dc->h - 4, FG(dc, normcol));
- if(lines > 0)
- drawmenuv();
- else if(curr && (dc->w == inputw || curr->next))
- drawmenuh();
- commitdraw(dc, win);
-}
-
-void
-drawmenuh(void) {
- Item *item;
-
- dc->x += inputw;
- dc->w = textw(dc, "<");
- if(curr->left)
- drawtext(dc, "<", normcol);
- for(item = curr; item != next; item = item->right) {
- dc->x += dc->w;
- dc->w = MIN(textw(dc, item->text), mw / 3);
- drawtext(dc, item->text, (item == sel) ? selcol : normcol);
+ if((curpos = textnw(dc, text, cursor) + dc->h/2 - 2) < dc->w)
+ drawrect(dc, curpos, 2, 1, dc->h - 4, True, FG(dc, normcol));
+
+ if(lines > 0) {
+ dc->w = mw - dc->x;
+ for(item = curr; item != next; item = item->right) {
+ dc->y += dc->h;
+ drawtext(dc, item->text, (item == sel) ? selcol : normcol);
+ }