Patch 8.2.4219

8 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 25, 2022, 4:26:57 PM1/25/22
to vim...@googlegroups.com

Patch 8.2.4219
Problem: Reading before the start of the line.
Solution: Check boundary before trying to read the character.
Files: src/register.c, src/testdir/test_visual.vim


*** ../vim-8.2.4218/src/register.c 2022-01-08 16:19:18.505639885 +0000
--- src/register.c 2022-01-25 21:25:33.448204164 +0000
***************
*** 1474,1480 ****
{
int s = bd->textlen + bd->endspaces;

! while (VIM_ISWHITE(*(bd->textstart + s - 1)) && s > 0)
{
s = s - (*mb_head_off)(bd->textstart, bd->textstart + s - 1) - 1;
pnew--;
--- 1474,1480 ----
{
int s = bd->textlen + bd->endspaces;

! while (s > 0 && VIM_ISWHITE(*(bd->textstart + s - 1)))
{
s = s - (*mb_head_off)(bd->textstart, bd->textstart + s - 1) - 1;
pnew--;
*** ../vim-8.2.4218/src/testdir/test_visual.vim 2022-01-25 18:23:57.102514548 +0000
--- src/testdir/test_visual.vim 2022-01-25 21:25:06.724710398 +0000
***************
*** 1247,1252 ****
--- 1247,1259 ----
bw!
endfunc

+ func Test_visual_block_yank_zy()
+ new
+ " this was reading before the start of the line
+ exe "norm o\<C-T>\<Esc>\<C-V>zy"
+ bwipe!
+ endfunc
+
func Test_visual_block_with_virtualedit()
CheckScreendump

*** ../vim-8.2.4218/src/version.c 2022-01-25 20:45:13.210333180 +0000
--- src/version.c 2022-01-25 21:25:57.663745451 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4219,
/**/

--
Violators can be fined, arrested or jailed for making ugly faces at a dog.
[real standing law in Oklahoma, United States of America]

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages