mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.1.2083: multi-byte chars do not work properly with "%.*S" in printf()
Problem: Multi-byte chars do not work properly with "%.*S" in printf(). Solution: Use mb_ptr2cells(). Daniel Hahler, closes #4989)
This commit is contained in:
@@ -248,6 +248,9 @@ function Test_printf_misc()
|
||||
call assert_equal('abc ', printf('%-4s', 'abc'))
|
||||
call assert_equal('abc ', printf('%-4S', 'abc'))
|
||||
|
||||
call assert_equal('🐍', printf('%.2S', '🐍🐍'))
|
||||
call assert_equal('', printf('%.1S', '🐍🐍'))
|
||||
|
||||
call assert_equal('1%', printf('%d%%', 1))
|
||||
endfunc
|
||||
|
||||
|
Reference in New Issue
Block a user