Patch 8.2.5058
Problem: input() does not handle composing characters properly.
Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
(closes #10527)
Files: src/getchar.c, src/testdir/test_functions.vim
*** ../vim-8.2.5057/src/getchar.c 2022-05-07 20:01:10.058731693 +0100
--- src/getchar.c 2022-06-05 18:55:39.764503940 +0100
***************
*** 669,675 ****
}
else
{
! c = mb_ptr2char_adv(&s);
if (c == CAR || c == NL || c == ESC)
c = ' ';
stuffcharReadbuff(c);
--- 669,675 ----
}
else
{
! c = mb_cptr2char_adv(&s);
if (c == CAR || c == NL || c == ESC)
c = ' ';
stuffcharReadbuff(c);
*** ../vim-8.2.5057/src/testdir/test_functions.vim 2022-05-26
12:10:33.589893490 +0100
--- src/testdir/test_functions.vim 2022-06-05 18:55:39.764503940 +0100
***************
*** 1545,1550 ****
--- 1545,1554 ----
call feedkeys(":let c = input('name? ', \"x\\<BS>y\")\<CR>\<CR>", 'xt')
call assert_equal('y', c)
+ " Test for using text with composing characters as default input
+ call feedkeys(":let c = input('name? ', \"ã̳\")\<CR>\<CR>", 'xt')
+ call assert_equal('ã̳', c)
+
" Test for using <CR> as default input
call feedkeys(":let c = input('name? ', \"\\<CR>\")\<CR>x\<CR>", 'xt')
call assert_equal(' x', c)
*** ../vim-8.2.5057/src/version.c 2022-06-05 16:55:50.702774344 +0100
--- src/version.c 2022-06-05 18:59:15.960457235 +0100
***************
*** 736,737 ****
--- 736,739 ----
{ /* Add new patch number below this line */
+ /**/
+ 5058,
/**/
--
If your life is a hard drive,
Christ can be your backup.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220605185305.EEA0E1C291C%40moolenaar.net.