Karsten Hopp 4e10fa
To: vim_dev@googlegroups.com
Karsten Hopp 4e10fa
Subject: Patch 7.4.034
Karsten Hopp 4e10fa
Fcc: outbox
Karsten Hopp 4e10fa
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 4e10fa
Mime-Version: 1.0
Karsten Hopp 4e10fa
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 4e10fa
Content-Transfer-Encoding: 8bit
Karsten Hopp 4e10fa
------------
Karsten Hopp 4e10fa
Karsten Hopp 4e10fa
Patch 7.4.034
Karsten Hopp 4e10fa
Problem:    Using "p" in Visual block mode only changes the first line.
Karsten Hopp 4e10fa
Solution:   Repeat the put in all text in the block. (Christian Brabandt)
Karsten Hopp 4e10fa
Files:	    runtime/doc/change.txt, src/ops.c, src/normal.c,
Karsten Hopp 4e10fa
	    src/testdir/test20.in, src/testdir/test20.ok
Karsten Hopp 4e10fa
Karsten Hopp 4e10fa
Karsten Hopp 4e10fa
*** ../vim-7.4.033/runtime/doc/change.txt	2013-08-10 13:24:52.000000000 +0200
Karsten Hopp 4e10fa
--- runtime/doc/change.txt	2013-09-22 15:12:20.000000000 +0200
Karsten Hopp 4e10fa
***************
Karsten Hopp 4e10fa
*** 1069,1074 ****
Karsten Hopp 4e10fa
--- 1069,1079 ----
Karsten Hopp 4e10fa
  replace and use "0p .  You can repeat this as many times as you like, the
Karsten Hopp 4e10fa
  unnamed register will be changed each time.
Karsten Hopp 4e10fa
  
Karsten Hopp 4e10fa
+ When you use a blockwise Visual mode command and yank only a single line into
Karsten Hopp 4e10fa
+ a register, a paste on a visual selected area will paste that single line on
Karsten Hopp 4e10fa
+ each of the selected lines (thus replacing the blockwise selected region by a
Karsten Hopp 4e10fa
+ block of the pasted line).
Karsten Hopp 4e10fa
+ 
Karsten Hopp 4e10fa
  							*blockwise-register*
Karsten Hopp 4e10fa
  If you use a blockwise Visual mode command to get the text into the register,
Karsten Hopp 4e10fa
  the block of text will be inserted before ("P") or after ("p") the cursor
Karsten Hopp 4e10fa
*** ../vim-7.4.033/src/ops.c	2013-08-09 19:34:32.000000000 +0200
Karsten Hopp 4e10fa
--- src/ops.c	2013-09-22 15:18:03.000000000 +0200
Karsten Hopp 4e10fa
***************
Karsten Hopp 4e10fa
*** 3776,3800 ****
Karsten Hopp 4e10fa
  	 */
Karsten Hopp 4e10fa
  	if (y_type == MCHAR && y_size == 1)
Karsten Hopp 4e10fa
  	{
Karsten Hopp 4e10fa
! 	    totlen = count * yanklen;
Karsten Hopp 4e10fa
! 	    if (totlen)
Karsten Hopp 4e10fa
! 	    {
Karsten Hopp 4e10fa
! 		oldp = ml_get(lnum);
Karsten Hopp 4e10fa
! 		newp = alloc_check((unsigned)(STRLEN(oldp) + totlen + 1));
Karsten Hopp 4e10fa
! 		if (newp == NULL)
Karsten Hopp 4e10fa
! 		    goto end;		/* alloc() will give error message */
Karsten Hopp 4e10fa
! 		mch_memmove(newp, oldp, (size_t)col);
Karsten Hopp 4e10fa
! 		ptr = newp + col;
Karsten Hopp 4e10fa
! 		for (i = 0; i < count; ++i)
Karsten Hopp 4e10fa
  		{
Karsten Hopp 4e10fa
! 		    mch_memmove(ptr, y_array[0], (size_t)yanklen);
Karsten Hopp 4e10fa
! 		    ptr += yanklen;
Karsten Hopp 4e10fa
  		}
Karsten Hopp 4e10fa
! 		STRMOVE(ptr, oldp + col);
Karsten Hopp 4e10fa
! 		ml_replace(lnum, newp, FALSE);
Karsten Hopp 4e10fa
! 		/* Put cursor on last putted char. */
Karsten Hopp 4e10fa
! 		curwin->w_cursor.col += (colnr_T)(totlen - 1);
Karsten Hopp 4e10fa
! 	    }
Karsten Hopp 4e10fa
  	    curbuf->b_op_end = curwin->w_cursor;
Karsten Hopp 4e10fa
  	    /* For "CTRL-O p" in Insert mode, put cursor after last char */
Karsten Hopp 4e10fa
  	    if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND)))
Karsten Hopp 4e10fa
--- 3776,3817 ----
Karsten Hopp 4e10fa
  	 */
Karsten Hopp 4e10fa
  	if (y_type == MCHAR && y_size == 1)
Karsten Hopp 4e10fa
  	{
Karsten Hopp 4e10fa
! 	    do {
Karsten Hopp 4e10fa
! 		totlen = count * yanklen;
Karsten Hopp 4e10fa
! 		if (totlen > 0)
Karsten Hopp 4e10fa
  		{
Karsten Hopp 4e10fa
! 		    oldp = ml_get(lnum);
Karsten Hopp 4e10fa
! 		    newp = alloc_check((unsigned)(STRLEN(oldp) + totlen + 1));
Karsten Hopp 4e10fa
! 		    if (newp == NULL)
Karsten Hopp 4e10fa
! 			goto end;	/* alloc() gave an error message */
Karsten Hopp 4e10fa
! 		    mch_memmove(newp, oldp, (size_t)col);
Karsten Hopp 4e10fa
! 		    ptr = newp + col;
Karsten Hopp 4e10fa
! 		    for (i = 0; i < count; ++i)
Karsten Hopp 4e10fa
! 		    {
Karsten Hopp 4e10fa
! 			mch_memmove(ptr, y_array[0], (size_t)yanklen);
Karsten Hopp 4e10fa
! 			ptr += yanklen;
Karsten Hopp 4e10fa
! 		    }
Karsten Hopp 4e10fa
! 		    STRMOVE(ptr, oldp + col);
Karsten Hopp 4e10fa
! 		    ml_replace(lnum, newp, FALSE);
Karsten Hopp 4e10fa
! 		    /* Place cursor on last putted char. */
Karsten Hopp 4e10fa
! 		    if (lnum == curwin->w_cursor.lnum)
Karsten Hopp 4e10fa
! 			curwin->w_cursor.col += (colnr_T)(totlen - 1);
Karsten Hopp 4e10fa
  		}
Karsten Hopp 4e10fa
! #ifdef FEAT_VISUAL
Karsten Hopp 4e10fa
! 		if (VIsual_active)
Karsten Hopp 4e10fa
! 		    lnum++;
Karsten Hopp 4e10fa
! #endif
Karsten Hopp 4e10fa
! 	    } while (
Karsten Hopp 4e10fa
! #ifdef FEAT_VISUAL
Karsten Hopp 4e10fa
! 		    VIsual_active && lnum <= curbuf->b_visual.vi_end.lnum
Karsten Hopp 4e10fa
! #else
Karsten Hopp 4e10fa
! 		    FALSE /* stop after 1 paste */
Karsten Hopp 4e10fa
! #endif
Karsten Hopp 4e10fa
! 		    );
Karsten Hopp 4e10fa
! #ifdef FEAT_VISUAL
Karsten Hopp 4e10fa
! 	    VIsual_active = FALSE;
Karsten Hopp 4e10fa
! #endif
Karsten Hopp 4e10fa
! 
Karsten Hopp 4e10fa
  	    curbuf->b_op_end = curwin->w_cursor;
Karsten Hopp 4e10fa
  	    /* For "CTRL-O p" in Insert mode, put cursor after last char */
Karsten Hopp 4e10fa
  	    if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND)))
Karsten Hopp 4e10fa
*** ../vim-7.4.033/src/normal.c	2013-07-14 13:24:37.000000000 +0200
Karsten Hopp 4e10fa
--- src/normal.c	2013-09-22 15:15:18.000000000 +0200
Karsten Hopp 4e10fa
***************
Karsten Hopp 4e10fa
*** 9518,9523 ****
Karsten Hopp 4e10fa
--- 9518,9525 ----
Karsten Hopp 4e10fa
  		/* cursor is at the end of the line or end of file, put
Karsten Hopp 4e10fa
  		 * forward. */
Karsten Hopp 4e10fa
  		dir = FORWARD;
Karsten Hopp 4e10fa
+ 	    /* May have been reset in do_put(). */
Karsten Hopp 4e10fa
+ 	    VIsual_active = TRUE;
Karsten Hopp 4e10fa
  	}
Karsten Hopp 4e10fa
  #endif
Karsten Hopp 4e10fa
  	do_put(cap->oap->regname, dir, cap->count1, flags);
Karsten Hopp 4e10fa
*** ../vim-7.4.033/src/testdir/test20.in	2010-05-15 13:04:10.000000000 +0200
Karsten Hopp 4e10fa
--- src/testdir/test20.in	2013-09-22 15:11:37.000000000 +0200
Karsten Hopp 4e10fa
***************
Karsten Hopp 4e10fa
*** 9,19 ****
Karsten Hopp 4e10fa
  @auY:quit!
Karsten Hopp 4e10fa
  GP
Karsten Hopp 4e10fa
  /start here$
Karsten Hopp 4e10fa
! ?jjlld
Karsten Hopp 4e10fa
! :/here$/,$-1w! test.out
Karsten Hopp 4e10fa
  :qa!
Karsten Hopp 4e10fa
  ENDTEST
Karsten Hopp 4e10fa
  
Karsten Hopp 4e10fa
  test text test tex start here
Karsten Hopp 4e10fa
  		some text
Karsten Hopp 4e10fa
  		test text
Karsten Hopp 4e10fa
--- 9,25 ----
Karsten Hopp 4e10fa
  @auY:quit!
Karsten Hopp 4e10fa
  GP
Karsten Hopp 4e10fa
  /start here$
Karsten Hopp 4e10fa
! "by$?jjlld
Karsten Hopp 4e10fa
! /456$
Karsten Hopp 4e10fa
! ?jj"bP
Karsten Hopp 4e10fa
! :/56$/,$-1w! test.out
Karsten Hopp 4e10fa
  :qa!
Karsten Hopp 4e10fa
  ENDTEST
Karsten Hopp 4e10fa
  
Karsten Hopp 4e10fa
+ 123456
Karsten Hopp 4e10fa
+ 234567
Karsten Hopp 4e10fa
+ 345678
Karsten Hopp 4e10fa
+ 
Karsten Hopp 4e10fa
  test text test tex start here
Karsten Hopp 4e10fa
  		some text
Karsten Hopp 4e10fa
  		test text
Karsten Hopp 4e10fa
*** ../vim-7.4.033/src/testdir/test20.ok	2010-05-15 13:04:10.000000000 +0200
Karsten Hopp 4e10fa
--- src/testdir/test20.ok	2013-09-22 15:11:37.000000000 +0200
Karsten Hopp 4e10fa
***************
Karsten Hopp 4e10fa
*** 1,3 ****
Karsten Hopp 4e10fa
--- 1,7 ----
Karsten Hopp 4e10fa
+ 123start here56
Karsten Hopp 4e10fa
+ 234start here67
Karsten Hopp 4e10fa
+ 345start here78
Karsten Hopp 4e10fa
+ 
Karsten Hopp 4e10fa
  test text test tex rt here
Karsten Hopp 4e10fa
  		somext
Karsten Hopp 4e10fa
  		tesext
Karsten Hopp 4e10fa
*** ../vim-7.4.033/src/version.c	2013-09-22 15:03:34.000000000 +0200
Karsten Hopp 4e10fa
--- src/version.c	2013-09-22 15:14:04.000000000 +0200
Karsten Hopp 4e10fa
***************
Karsten Hopp 4e10fa
*** 740,741 ****
Karsten Hopp 4e10fa
--- 740,743 ----
Karsten Hopp 4e10fa
  {   /* Add new patch number below this line */
Karsten Hopp 4e10fa
+ /**/
Karsten Hopp 4e10fa
+     34,
Karsten Hopp 4e10fa
  /**/
Karsten Hopp 4e10fa
Karsten Hopp 4e10fa
-- 
Karsten Hopp 4e10fa
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 4e10fa
249. You've forgotten what the outside looks like.
Karsten Hopp 4e10fa
Karsten Hopp 4e10fa
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 4e10fa
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 4e10fa
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 4e10fa
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///