commit 8115fd4a99b30c65da4fa4e88552b7aa36b71165 from: Omar Polo date: Thu May 05 08:54:29 2022 UTC reset all the state functions regardless of MB_READ vs. MB_COMPLREAD must_select otherwise is set when MB_COMPREAD but not cleared on MB_READ, yielding funny errors. While here, move also the other parts of the state out of the if (MB_COMPLREAD) to avoid this kind of issues in the future. commit - fd984e767a8e0e4978cfe072899282a8265a911e commit + 8115fd4a99b30c65da4fa4e88552b7aa36b71165 blob - f12756a98c82f0afcdb1f648e668b0c48b3355bd blob + a386f9e2a59d33470142e32733c51808f8ac17bc --- minibuffer.c +++ minibuffer.c @@ -508,14 +508,14 @@ enter_minibuffer(void (*self_insert_fn)(void), void (* void (*abortfn)(void), struct histhead *hist, complfn *complfn, void *compldata, int must_select) { + ministate.compl.must_select = must_select; + ministate.compl.fn = complfn; + ministate.compl.data = compldata; + in_minibuffer = complfn == NULL ? MB_READ : MB_COMPREAD; if (in_minibuffer == MB_COMPREAD) { + populate_compl_buffer(complfn, compldata); ui_schedule_redraw(); - - ministate.compl.fn = complfn; - ministate.compl.data = compldata; - ministate.compl.must_select = must_select; - populate_compl_buffer(complfn, compldata); } base_map = &minibuffer_map;