Patch 8.2.3072
Problem:    The "zy" command does not work well when 'virtualedit' is set to
            "block". (Johann Höchtl)
Solution:   Make endspaces zero. (Christian Brabandt, closes #8468,
            closes #8448)
Files:      src/register.c, src/testdir/test_visual.vim


*** ../vim-8.2.3071/src/register.c      2021-06-16 15:53:13.072696639 +0200
--- src/register.c      2021-06-28 21:42:57.126401043 +0200
***************
*** 1455,1460 ****
--- 1455,1462 ----
  {
      char_u    *pnew;
  
+     if (exclude_trailing_space)
+       bd->endspaces = 0;
      if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1))
                                                                      == NULL)
        return FAIL;
***************
*** 2747,2753 ****
                &yank_type) == FAIL)
        return;
  
!     str_to_reg(y_current, yank_type, (char_u *) strings, -1, block_len, TRUE);
  
      finish_write_reg(name, old_y_previous, old_y_current);
  }
--- 2749,2755 ----
                &yank_type) == FAIL)
        return;
  
!     str_to_reg(y_current, yank_type, (char_u *)strings, -1, block_len, TRUE);
  
      finish_write_reg(name, old_y_previous, old_y_current);
  }
*** ../vim-8.2.3071/src/testdir/test_visual.vim 2021-06-10 19:39:07.277697688 
+0200
--- src/testdir/test_visual.vim 2021-06-28 21:42:57.126401043 +0200
***************
*** 1,6 ****
--- 1,7 ----
  " Tests for various Visual modes.
  
  source shared.vim
+ source check.vim
  
  func Test_block_shift_multibyte()
    " Uses double-wide character.
***************
*** 1225,1229 ****
--- 1226,1249 ----
    bwipe!
  endfunc
  
+ func Test_visual_put_blockedit_zy_and_zp()
+   new
+ 
+   call setline(1, ['aa', 'bbbbb', 'ccc', '', 'XX', 'GGHHJ', 'RTZU'])
+   exe "normal! gg0\<c-v>2j$zy"
+   norm! 5gg0zP
+   call assert_equal(['aa', 'bbbbb', 'ccc', '', 'aaXX', 'bbbbbGGHHJ', 
'cccRTZU'], getline(1, 7))
+   "
+   " now with blockmode editing
+   sil %d
+   :set ve=block
+   call setline(1, ['aa', 'bbbbb', 'ccc', '', 'XX', 'GGHHJ', 'RTZU'])
+   exe "normal! gg0\<c-v>2j$zy"
+   norm! 5gg0zP
+   call assert_equal(['aa', 'bbbbb', 'ccc', '', 'aaXX', 'bbbbbGGHHJ', 
'cccRTZU'], getline(1, 7))
+   set ve&vim
+   bw!
+ endfunc
+ 
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3071/src/version.c       2021-06-28 20:53:12.390870518 +0200
--- src/version.c       2021-06-28 21:46:06.369892623 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3072,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
44. Your friends no longer send you e-mail...they just log on to your IRC
    channel.

 /// 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/202106281955.15SJt5Z6984327%40masaka.moolenaar.net.

Raspunde prin e-mail lui