To: vim_dev@googlegroups.com Subject: Patch 7.4.1161 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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) Files: src/ex_cmds.h, src/ex_cmds2.c, src/testdir/test_arglist.vim *** ../vim-7.4.1160/src/ex_cmds.h 2015-12-31 16:10:18.518599704 +0100 --- src/ex_cmds.h 2016-01-23 22:56:50.332354102 +0100 *************** *** 128,134 **** BANG|FILES|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_argadd, "argadd", ex_argadd, ! BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR, ADDR_ARGUMENTS), EX(CMD_argdelete, "argdelete", ex_argdelete, BANG|RANGE|NOTADR|FILES|TRLBAR, --- 128,134 ---- BANG|FILES|EDITCMD|ARGOPT|TRLBAR, ADDR_LINES), EX(CMD_argadd, "argadd", ex_argadd, ! BANG|RANGE|NOTADR|ZEROR|FILES|TRLBAR, ADDR_ARGUMENTS), EX(CMD_argdelete, "argdelete", ex_argdelete, BANG|RANGE|NOTADR|FILES|TRLBAR, *** ../vim-7.4.1160/src/ex_cmds2.c 2016-01-17 19:38:56.147067400 +0100 --- src/ex_cmds2.c 2016-01-23 22:58:49.359058440 +0100 *************** *** 2090,2095 **** --- 2090,2105 ---- #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". */ if (get_arglist(&new_ga, str) == FAIL) *** ../vim-7.4.1160/src/testdir/test_arglist.vim 2016-01-19 14:14:01.859675412 +0100 --- src/testdir/test_arglist.vim 2016-01-23 22:55:04.381507978 +0100 *************** *** 57,62 **** --- 57,73 ---- +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() *** ../vim-7.4.1160/src/version.c 2016-01-23 22:51:02.748141627 +0100 --- src/version.c 2016-01-23 22:56:20.208682114 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 1161, /**/ -- In many of the more relaxed civilizations on the Outer Eastern Rim of the Galaxy, "The Hitchhiker's Guide to the Galaxy" has already supplanted the great "Encyclopedia Galactica" as the standard repository of all knowledge and wisdom, for though it has many omissions and contains much that is apocryphal, or at least wildly inaccurate, it scores over the older, more pedestrian work in two important respects. First, it is slightly cheaper; and second, it has the words "DON'T PANIC" inscribed in large friendly letters on its cover. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///