To: vim_dev@googlegroups.com Subject: Patch 8.0.1557 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1557 Problem: printf() does not work with only one argument. (Daniel Hahler) Solution: Allow using just the format. (Ken Takata, closes #2687) Files: src/evalfunc.c, src/testdir/test_expr.vim *** ../vim-8.0.1556/src/evalfunc.c 2018-02-22 21:06:44.558819084 +0100 --- src/evalfunc.c 2018-03-03 14:51:48.364717089 +0100 *************** *** 738,744 **** {"pow", 2, 2, f_pow}, #endif {"prevnonblank", 1, 1, f_prevnonblank}, ! {"printf", 2, 19, f_printf}, {"pumvisible", 0, 0, f_pumvisible}, #ifdef FEAT_PYTHON3 {"py3eval", 1, 1, f_py3eval}, --- 738,744 ---- {"pow", 2, 2, f_pow}, #endif {"prevnonblank", 1, 1, f_prevnonblank}, ! {"printf", 1, 19, f_printf}, {"pumvisible", 0, 0, f_pumvisible}, #ifdef FEAT_PYTHON3 {"py3eval", 1, 1, f_py3eval}, *** ../vim-8.0.1556/src/testdir/test_expr.vim 2017-03-18 20:18:42.063950224 +0100 --- src/testdir/test_expr.vim 2018-03-03 14:56:04.267153847 +0100 *************** *** 131,136 **** --- 131,139 ---- endfunc function Test_printf_misc() + call assert_equal('123', printf('123')) + call assert_fails("call printf('123', 3)", "E767:") + call assert_equal('123', printf('%d', 123)) call assert_equal('123', printf('%i', 123)) call assert_equal('123', printf('%D', 123)) *** ../vim-8.0.1556/src/version.c 2018-03-02 20:58:36.286811942 +0100 --- src/version.c 2018-03-03 14:53:36.348057157 +0100 *************** *** 780,781 **** --- 780,783 ---- { /* Add new patch number below this line */ + /**/ + 1557, /**/ -- This message contains 78% recycled characters. /// 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 ///