]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1083: setreg() doesn't correctly handle mbyte chars in blockwise mode v9.1.1083
authorYee Cheng Chin <ychin.git@gmail.com>
Sat, 8 Feb 2025 17:19:15 +0000 (18:19 +0100)
committerChristian Brabandt <cb@256bit.org>
Sat, 8 Feb 2025 17:19:15 +0000 (18:19 +0100)
commita17f8bfb282805ee8ded014089d3094ef6dbf913
treeb08963ce92df8e9963d169887f4858a4732a8bc9
parenta6d5778d9b14d6c194d23f01c8ddfdcdc08c7974
patch 9.1.1083: setreg() doesn't correctly handle mbyte chars in blockwise mode

Problem:  setreg() doesn't correctly handle mbyte chars in blockwise
          mode
Solution: use mb_ptr2len_len function pointer (Yee Cheng Chin)

setreg() will automatically calculate the width when a blockwise mode is
specified, but it does not properly calculate the line widths of mbyte
characters when value is passed as newline-terminated string. It does
work when value is passed as a list of lines though.

Fix this by properly using the mbyte function pointer to increment the
loop counter.

closes: #16596

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/register.c
src/testdir/test_registers.vim
src/version.c