Patch 8.2.4988
Problem:    Textprop in wrong position when replacing multi-byte chars.
Solution:   Adjust textprop position. (closes #10461)
Files:      src/change.c, src/testdir/test_textprop.vim


*** ../vim-8.2.4987/src/change.c        2022-05-16 19:40:54.757799730 +0100
--- src/change.c        2022-05-21 11:17:47.550077484 +0100
***************
*** 1118,1124 ****
      ml_replace(lnum, newp, FALSE);
  
      // mark the buffer as changed and prepare for displaying
!     inserted_bytes(lnum, col, newlen - oldlen);
  
      // If we're in Insert or Replace mode and 'showmatch' is set, then briefly
      // show the match for right parens and braces.
--- 1118,1129 ----
      ml_replace(lnum, newp, FALSE);
  
      // mark the buffer as changed and prepare for displaying
!     changed_bytes(lnum, col);
! #ifdef FEAT_PROP_POPUP
!     if (curbuf->b_has_textprop && newlen != oldlen)
!       adjust_prop_columns(lnum, col, newlen - oldlen,
!                                   State & REPLACE_FLAG ? APC_SUBSTITUTE : 0);
! #endif
  
      // If we're in Insert or Replace mode and 'showmatch' is set, then briefly
      // show the match for right parens and braces.
*** ../vim-8.2.4987/src/testdir/test_textprop.vim       2022-05-15 
22:24:51.536182715 +0100
--- src/testdir/test_textprop.vim       2022-05-21 11:16:04.062085721 +0100
***************
*** 573,578 ****
--- 573,585 ----
    call assert_equal('yyyex xyyoxx', getline(1))
    call assert_equal(expected, prop_list(1))
  
+   " Replace three 1-byte chars with three 2-byte ones.
+   exe "normal 0l3rø"
+   call assert_equal('yøøøx xyyoxx', getline(1))
+   let expected[0].length += 3
+   let expected[1].col += 3
+   call assert_equal(expected, prop_list(1))
+ 
    call DeletePropTypes()
    bwipe!
    set bs&
*** ../vim-8.2.4987/src/version.c       2022-05-20 18:25:15.809240687 +0100
--- src/version.c       2022-05-21 11:17:31.334078521 +0100
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4988,
  /**/

-- 
"Marriage is when a man and woman become as one; the trouble starts
when they try to decide which one"

 /// 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/20220521102116.0C77F1C0475%40moolenaar.net.

Raspunde prin e-mail lui