vim-patch:8.0.1557: printf() does not work with only one argument (#9038)

Problem:    printf() does not work with only one argument. (Daniel Hahler)
Solution:   Allow using just the format. (Ken Takata, closes vim/vim#2687)
c71807db9c
This commit is contained in:
Daniel Hahler 2018-09-23 17:15:17 +02:00 committed by Justin M. Keyes
parent 9183e2c67e
commit d3c90cbbb4
2 changed files with 4 additions and 1 deletions

View File

@ -222,7 +222,7 @@ return {
pathshorten={args=1},
pow={args=2},
prevnonblank={args=1},
printf={args=varargs(2)},
printf={args=varargs(1)},
pumvisible={},
py3eval={args=1},
pyeval={args=1},

View File

@ -166,6 +166,9 @@ function Test_printf_spec_s()
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))