summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-07-26 22:01:36 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-26 22:01:36 +0100
commit7db3a8e3298bf7c7c3f74cc9c1add04f29e78d2d (patch)
tree19f71ae7d60a24136a029b9d12685924054d7a00
parent30e212dac1d29536883c36918a465a38d81d6413 (diff)
downloadvim-git-7db3a8e3298bf7c7c3f74cc9c1add04f29e78d2d.tar.gz
patch 9.0.0089: fuzzy argument completion doesn't work for shell commandsv9.0.0089
Problem: Fuzzy argument completion doesn't work for shell commands. Solution: Check for cmdidx not being CMD_bang. (Yegappan Lakshmanan, closes #10769)
-rw-r--r--src/cmdexpand.c6
-rw-r--r--src/testdir/test_cmdline.vim10
-rw-r--r--src/version.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 28ecaeda9..793a104d0 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -1305,8 +1305,10 @@ set_cmd_index(char_u *cmd, exarg_T *eap, expand_T *xp, int *complp)
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;
}
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index e1ee6336d..cd9aa2771 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -3144,6 +3144,16 @@ func Test_cmdline_complete_substitute_short()
endfor
endfunc
+" Test for :! shell command argument completion
+func Test_cmdline_complete_bang_cmd_argument()
+ set wildoptions=fuzzy
+ call feedkeys(":!vim test_cmdline.\<Tab>\<C-B>\"\<CR>", 'xt')
+ call assert_equal('"!vim test_cmdline.vim', @:)
+ set wildoptions&
+ call feedkeys(":!vim test_cmdline.\<Tab>\<C-B>\"\<CR>", 'xt')
+ call assert_equal('"!vim test_cmdline.vim', @:)
+endfunc
+
func Check_completion()
call assert_equal('let a', getcmdline())
call assert_equal(6, getcmdpos())
diff --git a/src/version.c b/src/version.c
index 7c584245a..74fb0e15e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 89,
+/**/
88,
/**/
87,