mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
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)
2faa29f896
This commit is contained in:
@@ -88,7 +88,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='argadd',
|
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,
|
addr_type=ADDR_ARGUMENTS,
|
||||||
func='ex_argadd',
|
func='ex_argadd',
|
||||||
},
|
},
|
||||||
|
@@ -1487,9 +1487,15 @@ do_arglist (
|
|||||||
char_u *p;
|
char_u *p;
|
||||||
int match;
|
int match;
|
||||||
|
|
||||||
/*
|
// Set default argument for ":argadd" command.
|
||||||
* Collect all file name arguments in "new_ga".
|
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);
|
get_arglist(&new_ga, str);
|
||||||
|
|
||||||
if (what == AL_DEL) {
|
if (what == AL_DEL) {
|
||||||
|
@@ -521,7 +521,7 @@ static int included_patches[] = {
|
|||||||
1164,
|
1164,
|
||||||
1163,
|
1163,
|
||||||
// 1162 NA
|
// 1162 NA
|
||||||
// 1161,
|
1161,
|
||||||
1160,
|
1160,
|
||||||
// 1159 NA
|
// 1159 NA
|
||||||
// 1158 NA
|
// 1158 NA
|
||||||
|
@@ -84,6 +84,17 @@ describe('argument list commands', function()
|
|||||||
execute('+2argadd y')
|
execute('+2argadd y')
|
||||||
assert_argc({'a', 'b', 'c', 'x', 'y'})
|
assert_argc({'a', 'b', 'c', 'x', 'y'})
|
||||||
eq(1, eval('argidx()'))
|
eq(1, eval('argidx()'))
|
||||||
|
|
||||||
|
execute('%argd')
|
||||||
|
execute('edit d')
|
||||||
|
execute('arga')
|
||||||
|
eq(1, eval('len(argv())'))
|
||||||
|
eq('d', eval('get(argv(), 0, "")'))
|
||||||
|
|
||||||
|
execute('%argd')
|
||||||
|
execute('new')
|
||||||
|
execute('arga')
|
||||||
|
eq(0, eval('len(argv())'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('test for [count]argument and [count]argdelete commands', function()
|
it('test for [count]argument and [count]argdelete commands', function()
|
||||||
|
Reference in New Issue
Block a user