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 #577)
This commit is contained in:
Bram Moolenaar
2016-01-23 23:02:34 +01:00
parent bd4593ffb1
commit 2faa29f896
4 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ EX(CMD_args, "args", ex_args,
BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
ADDR_LINES),
EX(CMD_argadd, "argadd", ex_argadd,
BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR,
BANG|RANGE|NOTADR|ZEROR|FILES|TRLBAR,
ADDR_ARGUMENTS),
EX(CMD_argdelete, "argdelete", ex_argdelete,
BANG|RANGE|NOTADR|FILES|TRLBAR,
+10
View File
@@ -2089,6 +2089,16 @@ do_arglist(str, what, after)
int match;
#endif
/*
* 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".
*/
+11
View File
@@ -57,6 +57,17 @@ func Test_argadd()
+2argadd y
call Assert_argc(['a', 'b', 'c', 'x', 'y'])
call assert_equal(1, argidx())
%argd
edit d
arga
call assert_equal(len(argv()), 1)
call assert_equal(get(argv(), 0, ''), 'd')
%argd
new
arga
call assert_equal(len(argv()), 0)
endfunc
func Init_abc()
+2
View File
@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1161,
/**/
1160,
/**/