vim-patch:9.1.0770: current command line completion is a bit limited (#30728)

Problem:  current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
          function (Ruslan Russkikh).

closes: vim/vim#15823

0407d621bb

Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
This commit is contained in:
zeertzjq
2024-10-09 08:14:18 +08:00
committed by GitHub
parent e98b1b0235
commit f449a38f6a
11 changed files with 161 additions and 23 deletions

View File

@@ -119,6 +119,7 @@ static bool cmdline_fuzzy_completion_supported(const expand_T *const xp)
&& xp->xp_context != EXPAND_PACKADD
&& xp->xp_context != EXPAND_RUNTIME
&& xp->xp_context != EXPAND_SHELLCMD
&& xp->xp_context != EXPAND_SHELLCMDLINE
&& xp->xp_context != EXPAND_TAGS
&& xp->xp_context != EXPAND_TAGS_LISTFILES
&& xp->xp_context != EXPAND_USER_LIST
@@ -1527,7 +1528,8 @@ static void set_context_for_wildcard_arg(exarg_T *eap, const char *arg, bool use
xp->xp_context = EXPAND_FILES;
// For a shell command more chars need to be escaped.
if (usefilter || eap->cmdidx == CMD_bang || eap->cmdidx == CMD_terminal) {
if (usefilter || eap->cmdidx == CMD_bang || eap->cmdidx == CMD_terminal
|| *complp == EXPAND_SHELLCMDLINE) {
#ifndef BACKSLASH_IN_FILENAME
xp->xp_shell = true;
#endif