vim-patch:9.0.0089: fuzzy argument completion doesn't work for shell commands (#21852)

Problem:    Fuzzy argument completion doesn't work for shell commands.
Solution:   Check for cmdidx not being CMD_bang. (Yegappan Lakshmanan,
            closes vim/vim#10769)

7db3a8e329

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq
2023-01-17 16:28:15 +08:00
committed by GitHub
parent fc692dfce1
commit 8abf53be6e
2 changed files with 14 additions and 2 deletions

View File

@@ -1418,8 +1418,10 @@ static const char *set_cmd_index(const char *cmd, exarg_T *eap, expand_T *xp, in
eap->cmdidx = excmd_get_cmdidx(cmd, len);
// User defined commands support alphanumeric characters.
// Also when doing fuzzy expansion, support alphanumeric characters.
if ((cmd[0] >= 'A' && cmd[0] <= 'Z') || (fuzzy && *p != NUL)) {
// Also when doing fuzzy expansion for non-shell commands, support
// alphanumeric characters.
if ((cmd[0] >= 'A' && cmd[0] <= 'Z')
|| (fuzzy && eap->cmdidx != CMD_bang && *p != NUL)) {
while (ASCII_ISALNUM(*p) || *p == '*') { // Allow * wild card
p++;
}