From 055c9e1be6d73fa4a4f84299dbdbcaf8e2db140a Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 14 May 2016 15:51:44 +0200 Subject: vim-patch:7.4.1161 Problem: ":argadd" without argument is supposed to add the current buffer name to the arglist. Solution: Make it work as documented. (Coot, closes vim/vim#577) https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8 --- src/nvim/ex_cmds.lua | 2 +- src/nvim/ex_cmds2.c | 12 +++++++++--- src/nvim/version.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/nvim') diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 04fd88cc8d..6c58879d58 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -88,7 +88,7 @@ return { }, { command='argadd', - flags=bit.bor(BANG, NEEDARG, RANGE, NOTADR, ZEROR, FILES, TRLBAR), + flags=bit.bor(BANG, RANGE, NOTADR, ZEROR, FILES, TRLBAR), addr_type=ADDR_ARGUMENTS, func='ex_argadd', }, diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index b6d0ef78cf..fd299eaa8a 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1487,9 +1487,15 @@ do_arglist ( char_u *p; int match; - /* - * Collect all file name arguments in "new_ga". - */ + // Set default argument for ":argadd" command. + if (what == AL_ADD && *str == NUL) { + if (curbuf->b_ffname == NULL) { + return FAIL; + } + str = curbuf->b_fname; + } + + // Collect all file name arguments in "new_ga". get_arglist(&new_ga, str); if (what == AL_DEL) { diff --git a/src/nvim/version.c b/src/nvim/version.c index 09f6ef6301..da90bc588f 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -521,7 +521,7 @@ static int included_patches[] = { 1164, 1163, // 1162 NA - // 1161, + 1161, 1160, // 1159 NA // 1158 NA -- cgit