Mercurial > vim
comparison src/testdir/test_functions.vim @ 29073:c7bd1040a1c4 v8.2.5058
patch 8.2.5058: input() does not handle composing characters properly
Commit: https://github.com/vim/vim/commit/e3a529bc877909a9eccf792461050b4f6737ed33
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Jun 5 19:01:37 2022 +0100
patch 8.2.5058: input() does not handle composing characters properly
Problem: input() does not handle composing characters properly.
Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
(closes #10527)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Jun 2022 20:15:02 +0200 |
parents | 644b0f0541de |
children | 72d1b2ea70dc |
comparison
equal
deleted
inserted
replaced
29072:44b520fb2185 | 29073:c7bd1040a1c4 |
---|---|
1543 | 1543 |
1544 " Test for using special characters as default input | 1544 " Test for using special characters as default input |
1545 call feedkeys(":let c = input('name? ', \"x\\<BS>y\")\<CR>\<CR>", 'xt') | 1545 call feedkeys(":let c = input('name? ', \"x\\<BS>y\")\<CR>\<CR>", 'xt') |
1546 call assert_equal('y', c) | 1546 call assert_equal('y', c) |
1547 | 1547 |
1548 " Test for using text with composing characters as default input | |
1549 call feedkeys(":let c = input('name? ', \"ã̳\")\<CR>\<CR>", 'xt') | |
1550 call assert_equal('ã̳', c) | |
1551 | |
1548 " Test for using <CR> as default input | 1552 " Test for using <CR> as default input |
1549 call feedkeys(":let c = input('name? ', \"\\<CR>\")\<CR>x\<CR>", 'xt') | 1553 call feedkeys(":let c = input('name? ', \"\\<CR>\")\<CR>x\<CR>", 'xt') |
1550 call assert_equal(' x', c) | 1554 call assert_equal(' x', c) |
1551 | 1555 |
1552 call assert_fails("call input('F:', '', 'invalid')", 'E180:') | 1556 call assert_fails("call input('F:', '', 'invalid')", 'E180:') |