To: vim_dev@googlegroups.com Subject: Patch 8.2.5058 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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\\y\")\\", 'xt') call assert_equal('y', c) + " Test for using text with composing characters as default input + call feedkeys(":let c = input('name? ', \"ã̳\")\\", 'xt') + call assert_equal('ã̳', c) + " Test for using as default input call feedkeys(":let c = input('name? ', \"\\\")\x\", '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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///