commit 1faa682136aa29eb489b92dcd0e72d28a777f763 from: Omar Polo date: Fri Apr 15 15:46:59 2022 UTC recompute_completions: use the history too when viewing it commit - 47eb6cd728d9e56a97c0aeac9791e7e0eb4ad3eb commit + 1faa682136aa29eb489b92dcd0e72d28a777f763 blob - 426de4a3ce6131d783fa65de732829d641804f81 blob + 555f1d665c6d73a02a51cb9379bf25597b553d06 --- minibuffer.c +++ minibuffer.c @@ -89,6 +89,7 @@ void recompute_completions(int add) { static char buf[GEMINI_URL_LEN]; + const char *text; char *input, **ap, *words[10]; size_t len = 0; struct line *l; @@ -98,7 +99,12 @@ recompute_completions(int add) if (in_minibuffer != MB_COMPREAD) return; - strlcpy(buf, ministate.buf, sizeof(buf)); + if (ministate.hist_cur != NULL) + text = ministate.hist_cur->h; + else + text = ministate.buf; + + strlcpy(buf, text, sizeof(buf)); input = buf; /* tokenize the input */