# HG changeset patch # User Bram Moolenaar # Date 1593793803 -7200 # Node ID f86140ad01646e71f2a5854fb70bb7bb2048e621 # Parent d5c03e28c4b7fdb1777f0d73f5859ed7ed8569bc patch 8.2.1121: command completion not working after ++arg Commit: https://github.com/vim/vim/commit/743d0620203388bf87dc611cea544b485e4b9f85 Author: Bram Moolenaar Date: Fri Jul 3 18:15:06 2020 +0200 patch 8.2.1121: command completion not working after ++arg Problem: Command completion not working after ++arg. Solution: Move skipping up. (Christian Brabandt, closes https://github.com/vim/vim/issues/6382) diff --git a/src/cmdexpand.c b/src/cmdexpand.c --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -1099,6 +1099,15 @@ set_one_cmd_context( arg = skipwhite(p); + // Skip over ++argopt argument + if ((ea.argt & EX_ARGOPT) && *arg != NUL && STRNCMP(arg, "++", 2) == 0) + { + p = arg; + while (*p && !vim_isspace(*p)) + MB_PTR_ADV(p); + arg = skipwhite(p); + } + if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update) { if (*arg == '>') // append @@ -1146,14 +1155,6 @@ set_one_cmd_context( arg = skipwhite(arg); } - // Skip over ++argopt argument - if ((ea.argt & EX_ARGOPT) && *arg != NUL && STRNCMP(arg, "++", 2) == 0) - { - p = arg; - while (*p && !vim_isspace(*p)) - MB_PTR_ADV(p); - arg = skipwhite(p); - } // Check for '|' to separate commands and '"' to start comments. // Don't do this for ":read !cmd" and ":write !cmd". diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -1593,8 +1593,11 @@ func Test_read_shellcmd() call feedkeys(":r! ++enc=utf-8 r\\\"\", 'tx') call assert_notmatch('^"r!.*\', @:) call assert_match('^"r!.*\', @:) + + call feedkeys(":r ++enc=utf-8 !rm\\\"\", 'tx') + call assert_notmatch('^"r.*\', @:) + call assert_match('^"r ++enc\S\+ !.*\', @:) endif endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1121, +/**/ 1120, /**/ 1119,