aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-12-26 21:05:57 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-12-26 21:10:13 -0500
commitb90ae75668cf8e8bec16755eaa7b6fa8a669a60e (patch)
tree97e04d5dddeb0d94eeca43ee2a9a6bac27e4bc65 /src
parent684172ae8299421a208a1e097c8ac4ec2118e01c (diff)
downloadrneovim-b90ae75668cf8e8bec16755eaa7b6fa8a669a60e.tar.gz
rneovim-b90ae75668cf8e8bec16755eaa7b6fa8a669a60e.tar.bz2
rneovim-b90ae75668cf8e8bec16755eaa7b6fa8a669a60e.zip
vim-patch:8.2.1121: command completion not working after ++arg
Problem: Command completion not working after ++arg. Solution: Move skipping up. (Christian Brabandt, closes vim/vim#6382) https://github.com/vim/vim/commit/743d0620203388bf87dc611cea544b485e4b9f85
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c18
-rw-r--r--src/nvim/testdir/test_cmdline.vim4
2 files changed, 13 insertions, 9 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index dea0d21ad2..8828e781b6 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -2979,6 +2979,15 @@ const char * set_one_cmd_context(
const char *arg = (const char *)skipwhite((const char_u *)p);
+ // Skip over ++argopt argument
+ if ((ea.argt & ARGOPT) && *arg != NUL && strncmp(arg, "++", 2) == 0) {
+ p = arg;
+ while (*p && !ascii_isspace(*p)) {
+ MB_PTR_ADV(p);
+ }
+ arg = (const char *)skipwhite((const char_u *)p);
+ }
+
if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update) {
if (*arg == '>') { // Append.
if (*++arg == '>') {
@@ -3020,15 +3029,6 @@ const char * set_one_cmd_context(
arg = (const char *)skipwhite((const char_u *)arg);
}
- // Skip over ++argopt argument
- if ((ea.argt & ARGOPT) && *arg != NUL && strncmp(arg, "++", 2) == 0) {
- p = arg;
- while (*p && !ascii_isspace(*p)) {
- MB_PTR_ADV(p);
- }
- arg = (const char *)skipwhite((const char_u *)p);
- }
-
/*
* Check for '|' to separate commands and '"' to start comments.
* Don't do this for ":read !cmd" and ":write !cmd".
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 09f02593a3..e9f529d217 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -967,6 +967,10 @@ func Test_read_shellcmd()
call feedkeys(":r! ++enc=utf-8 r\<c-a>\<c-b>\"\<cr>", 'tx')
call assert_notmatch('^"r!.*\<runtest.vim\>', @:)
call assert_match('^"r!.*\<rm\>', @:)
+
+ call feedkeys(":r ++enc=utf-8 !rm\<c-a>\<c-b>\"\<cr>", 'tx')
+ call assert_notmatch('^"r.*\<runtest.vim\>', @:)
+ call assert_match('^"r ++enc\S\+ !.*\<rm\>', @:)
endif
endfunc