aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-22 18:34:52 -0400
committerGitHub <noreply@github.com>2020-08-22 18:34:52 -0400
commit8c49e3d50959e24dadd688f56a18f104bd5fd934 (patch)
treee75e6d0435ce10e9df427c5b11e943127dad0983 /src/nvim/ex_cmds2.c
parent161cdba1e3b8b53f474b2e76655c8c1a5217802f (diff)
parent246c510b6022b7155c9b78767c41094df7cb2be8 (diff)
downloadrneovim-8c49e3d50959e24dadd688f56a18f104bd5fd934.tar.gz
rneovim-8c49e3d50959e24dadd688f56a18f104bd5fd934.tar.bz2
rneovim-8c49e3d50959e24dadd688f56a18f104bd5fd934.zip
Merge pull request #12770 from janlazo/vim-8.1.1115
vim-patch:8.1.{1115,2267},8.2.{607,814,1472,1474,1476,1511}
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r--src/nvim/ex_cmds2.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 7f4b01e306..7a06cb7ca6 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -1984,9 +1984,16 @@ void ex_argadd(exarg_T *eap)
/// ":argdelete"
void ex_argdelete(exarg_T *eap)
{
- if (eap->addr_count > 0) {
- // ":1,4argdel": Delete all arguments in the range.
- if (eap->line2 > ARGCOUNT) {
+ if (eap->addr_count > 0 || *eap->arg == NUL) {
+ // ":argdel" works like ":.argdel"
+ if (eap->addr_count == 0) {
+ if (curwin->w_arg_idx >= ARGCOUNT) {
+ EMSG(_("E610: No argument to delete"));
+ return;
+ }
+ eap->line1 = eap->line2 = curwin->w_arg_idx + 1;
+ } else if (eap->line2 > ARGCOUNT) {
+ // ":1,4argdel": Delete all arguments in the range.
eap->line2 = ARGCOUNT;
}
linenr_T n = eap->line2 - eap->line1 + 1;
@@ -2016,8 +2023,6 @@ void ex_argdelete(exarg_T *eap)
curwin->w_arg_idx = ARGCOUNT - 1;
}
}
- } else if (*eap->arg == NUL) {
- EMSG(_(e_argreq));
} else {
do_arglist(eap->arg, AL_DEL, 0);
}