To: vim_dev@googlegroups.com Subject: Patch 9.0.0089 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0089 Problem: Fuzzy argument completion doesn't work for shell commands. Solution: Check for cmdidx not being CMD_bang. (Yegappan Lakshmanan, closes #10769) Files: src/cmdexpand.c, src/testdir/test_cmdline.vim *** ../vim-9.0.0088/src/cmdexpand.c 2022-06-16 11:40:45.000000000 +0100 --- src/cmdexpand.c 2022-07-26 22:00:48.874196697 +0100 *************** *** 1305,1312 **** 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)) while (ASCII_ISALNUM(*p) || *p == '*') // Allow * wild card ++p; } --- 1305,1314 ---- eap->cmdidx = excmd_get_cmdidx(cmd, len); // User defined commands support alphanumeric characters. ! // 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; } *** ../vim-9.0.0088/src/testdir/test_cmdline.vim 2022-07-26 20:42:21.822448308 +0100 --- src/testdir/test_cmdline.vim 2022-07-26 21:56:54.399552555 +0100 *************** *** 3144,3149 **** --- 3144,3159 ---- endfor endfunc + " Test for :! shell command argument completion + func Test_cmdline_complete_bang_cmd_argument() + set wildoptions=fuzzy + call feedkeys(":!vim test_cmdline.\\\"\", 'xt') + call assert_equal('"!vim test_cmdline.vim', @:) + set wildoptions& + call feedkeys(":!vim test_cmdline.\\\"\", 'xt') + call assert_equal('"!vim test_cmdline.vim', @:) + endfunc + func Check_completion() call assert_equal('let a', getcmdline()) call assert_equal(6, getcmdpos()) *** ../vim-9.0.0088/src/version.c 2022-07-26 21:41:28.711069937 +0100 --- src/version.c 2022-07-26 22:00:59.918139023 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 89, /**/ -- hundred-and-one symptoms of being an internet addict: 144. You eagerly await the update of the "Cool Site of the Day." /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///