Patch 8.2.4217
Problem:    Illegal memory access when undo makes Visual area invalid.
Solution:   Correct the Visual area after undo.
Files:      src/undo.c, src/testdir/test_visual.vim


*** ../vim-8.2.4216/src/undo.c  2022-01-08 16:19:18.509639849 +0000
--- src/undo.c  2022-01-25 18:23:16.267308948 +0000
***************
*** 3029,3034 ****
--- 3029,3036 ----
        }
      }
  #endif
+     if (VIsual_active)
+       check_pos(curbuf, &VIsual);
  
      smsg_attr_keep(0, _("%ld %s; %s #%ld  %s"),
            u_oldcount < 0 ? -u_oldcount : u_oldcount,
*** ../vim-8.2.4216/src/testdir/test_visual.vim 2022-01-25 13:52:49.409429882 
+0000
--- src/testdir/test_visual.vim 2022-01-25 18:17:06.014445529 +0000
***************
*** 1339,1343 ****
--- 1339,1358 ----
    bwipe!
  endfunc
  
+ " This was leaving the end of the Visual area beyond the end of a line.
+ " Set 'undolevels' to start a new undo block.
+ func Test_visual_undo_deletes_last_line()
+   new
+   call setline(1, ["aaa", "ccc", "dyd"])
+   set undolevels=100
+   exe "normal obbbbbbbbbxbb\<Esc>"
+   set undolevels=100
+   /y
+   exe "normal ggvjfxO"
+   undo
+   normal gNU
+   bwipe!
+ endfunc
+ 
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4216/src/version.c       2022-01-25 15:51:52.434855097 +0000
--- src/version.c       2022-01-25 17:38:13.824799643 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4217,
  /**/

-- 
What do you get when you cross a joke with a rehtorical question?

 /// 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/20220125182439.E88051C343A%40moolenaar.net.

Raspunde prin e-mail lui