Patch 8.2.3678 (after 8.2.3677)
Problem:    Illegal memory access.
Solution:   Ignore changed indent when computing byte offset.
Files:      src/register.c


*** ../vim-8.2.3677/src/register.c      2021-11-25 19:31:11.415905063 +0000
--- src/register.c      2021-11-25 20:37:31.651563438 +0000
***************
*** 2099,2104 ****
--- 2099,2105 ----
        else
        {
            linenr_T    new_lnum = new_cursor.lnum;
+           size_t      len;
  
            // Insert at least one line.  When y_type is MCHAR, break the first
            // line in two.
***************
*** 2211,2221 ****
            // Put the '] mark on the first byte of the last inserted character.
            // Correct the length for change in indent.
            curbuf->b_op_end.lnum = new_lnum;
!           col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff;
            if (col > 1)
                curbuf->b_op_end.col = col - 1
                                - mb_head_off(y_array[y_size - 1],
!                                               y_array[y_size - 1] + col - 1);
            else
                curbuf->b_op_end.col = 0;
  
--- 2212,2223 ----
            // Put the '] mark on the first byte of the last inserted character.
            // Correct the length for change in indent.
            curbuf->b_op_end.lnum = new_lnum;
!           len = STRLEN(y_array[y_size - 1]);
!           col = (colnr_T)len - lendiff;
            if (col > 1)
                curbuf->b_op_end.col = col - 1
                                - mb_head_off(y_array[y_size - 1],
!                                               y_array[y_size - 1] + len - 1);
            else
                curbuf->b_op_end.col = 0;
  
*** ../vim-8.2.3677/src/version.c       2021-11-25 19:31:11.419905059 +0000
--- src/version.c       2021-11-25 20:38:21.843511468 +0000
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3678,
  /**/

-- 
Behold the warranty!  The bold print giveth and the fine print taketh.

 /// 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/20211125204040.6444F1C0A05%40moolenaar.net.

Raspunde prin e-mail lui