commit 7c1d55bff32b17bf9ac2b1a374c9cfb98935d847 from: Omar Polo date: Wed Apr 13 21:18:18 2022 UTC readd "select first completion" when must_select is provided The "don't automatically select the first completion" was a good change, but for commands that need a must_select policy it's annoying. This readds the automatic selection but only for those commands. It's still better than before the changes because now it's clear when and what gets automatically selected. commit - 27dbcaab4fac08fbb43df9eb5f10781ff7015bb6 commit + 7c1d55bff32b17bf9ac2b1a374c9cfb98935d847 blob - a5f554244e55478d8f19d20432e2b29fce7e19e7 blob + af012cdc506b6e1a1d66a5a8b4595c4de967b1f7 --- minibuffer.c +++ minibuffer.c @@ -92,6 +92,7 @@ recompute_completions(int add) char *input, **ap, *words[10]; size_t len = 0; struct line *l; + struct vline *vl; struct buffer *b; if (in_minibuffer != MB_COMPREAD) @@ -126,6 +127,9 @@ recompute_completions(int add) if (b->current_line == NULL) b->current_line = TAILQ_FIRST(&b->head); b->current_line = adjust_line(b->current_line, b); + vl = b->current_line; + if (ministate.compl.must_select) + vl->parent->type = LINE_COMPL_CURRENT; } int @@ -480,6 +484,10 @@ populate_compl_buffer(complfn *fn, void *data) linedata = NULL; descr = NULL; } + + if ((l = TAILQ_FIRST(&p->head)) != NULL && + ministate.compl.must_select) + l->type = LINE_COMPL_CURRENT; } void