diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-02-02 22:27:43 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-02-11 15:29:19 +0100 |
commit | bbdb074aec4f5ae1f61c451fb059e83d790e173e (patch) | |
tree | e7370af5b2335e0aff33f5b223ab3b5432fa59f5 /src | |
parent | 6df80e8762c4c7bd08434e203500aa4642123326 (diff) | |
download | rneovim-bbdb074aec4f5ae1f61c451fb059e83d790e173e.tar.gz rneovim-bbdb074aec4f5ae1f61c451fb059e83d790e173e.tar.bz2 rneovim-bbdb074aec4f5ae1f61c451fb059e83d790e173e.zip |
vim-patch:8.0.0721: :argedit can only have one argument
Problem: :argedit can only have one argument.
Solution: Allow for multiple arguments. (Christian Brabandt)
https://github.com/vim/vim/commit/90305c66a8637ea43a6509c7ab597734dd218365
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.lua | 2 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 32 |
2 files changed, 12 insertions, 22 deletions
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index c8593f7460..ce02808ad3 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -108,7 +108,7 @@ return { }, { command='argedit', - flags=bit.bor(BANG, NEEDARG, RANGE, NOTADR, ZEROR, FILE1, EDITCMD, ARGOPT, TRLBAR), + flags=bit.bor(BANG, NEEDARG, RANGE, NOTADR, ZEROR, FILES, EDITCMD, ARGOPT, TRLBAR), addr_type=ADDR_ARGUMENTS, func='ex_argedit', }, diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 0d3d68b855..27a96bb403 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1915,31 +1915,21 @@ void ex_next(exarg_T *eap) /// ":argedit" void ex_argedit(exarg_T *eap) { - int fnum; - int i; - char_u *s; - - // Add the argument to the buffer list and get the buffer number. - fnum = buflist_add(eap->arg, BLN_LISTED); + int i = eap->addr_count ? (int)eap->line2 : curwin->w_arg_idx + 1; - // Check if this argument is already in the argument list. - for (i = 0; i < ARGCOUNT; i++) { - if (ARGLIST[i].ae_fnum == fnum) { - break; - } - } - if (i == ARGCOUNT) { - // Can't find it, add it to the argument list. - s = vim_strsave(eap->arg); - int after = eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1; - i = alist_add_list(1, &s, after); - curwin->w_arg_idx = i; + if (do_arglist(eap->arg, AL_ADD, i) == FAIL) { + return; } + maketitle(); - alist_check_arg_idx(); - + if (curwin->w_arg_idx == 0 && (curbuf->b_ml.ml_flags & ML_EMPTY) + && curbuf->b_ffname == NULL) { + i = 0; + } // Edit the argument. - do_argfile(eap, i); + if (i < ARGCOUNT) { + do_argfile(eap, i); + } } /// ":argadd" |