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 -- [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/20220125212653.7FCF61C042A%40moolenaar.net.

Raspunde prin e-mail lui