Karsten Hopp 9d3f37
To: vim_dev@googlegroups.com
Karsten Hopp 9d3f37
Subject: Patch 7.4.085
Karsten Hopp 9d3f37
Fcc: outbox
Karsten Hopp 9d3f37
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 9d3f37
Mime-Version: 1.0
Karsten Hopp 9d3f37
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 9d3f37
Content-Transfer-Encoding: 8bit
Karsten Hopp 9d3f37
------------
Karsten Hopp 9d3f37
Karsten Hopp 9d3f37
Patch 7.4.085
Karsten Hopp 9d3f37
Problem:    When inserting text in Visual block mode and moving the cursor the
Karsten Hopp 9d3f37
            wrong text gets repeated in other lines.
Karsten Hopp 9d3f37
Solution:   Use the '[ mark to find the start of the actually inserted text.
Karsten Hopp 9d3f37
            (Christian Brabandt)
Karsten Hopp 9d3f37
Files:      src/ops.c, src/testdir/test39.in, src/testdir/test39.ok
Karsten Hopp 9d3f37
Karsten Hopp 9d3f37
Karsten Hopp 9d3f37
*** ../vim-7.4.084/src/ops.c	2013-11-05 07:12:59.000000000 +0100
Karsten Hopp 9d3f37
--- src/ops.c	2013-11-11 01:23:14.000000000 +0100
Karsten Hopp 9d3f37
***************
Karsten Hopp 9d3f37
*** 2640,2645 ****
Karsten Hopp 9d3f37
--- 2640,2670 ----
Karsten Hopp 9d3f37
      {
Karsten Hopp 9d3f37
  	struct block_def	bd2;
Karsten Hopp 9d3f37
  
Karsten Hopp 9d3f37
+ 	/* The user may have moved the cursor before inserting something, try
Karsten Hopp 9d3f37
+ 	 * to adjust the block for that. */
Karsten Hopp 9d3f37
+ 	if (oap->start.lnum == curbuf->b_op_start.lnum)
Karsten Hopp 9d3f37
+ 	{
Karsten Hopp 9d3f37
+ 	    if (oap->op_type == OP_INSERT
Karsten Hopp 9d3f37
+ 		    && oap->start.col != curbuf->b_op_start.col)
Karsten Hopp 9d3f37
+ 	    {
Karsten Hopp 9d3f37
+ 		oap->start.col = curbuf->b_op_start.col;
Karsten Hopp 9d3f37
+ 		pre_textlen -= getviscol2(oap->start.col, oap->start.coladd)
Karsten Hopp 9d3f37
+ 							    - oap->start_vcol;
Karsten Hopp 9d3f37
+ 		oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd);
Karsten Hopp 9d3f37
+ 	    }
Karsten Hopp 9d3f37
+ 	    else if (oap->op_type == OP_APPEND
Karsten Hopp 9d3f37
+ 		    && oap->end.col >= curbuf->b_op_start.col)
Karsten Hopp 9d3f37
+ 	    {
Karsten Hopp 9d3f37
+ 		oap->start.col = curbuf->b_op_start.col;
Karsten Hopp 9d3f37
+ 		/* reset pre_textlen to the value of OP_INSERT */
Karsten Hopp 9d3f37
+ 		pre_textlen += bd.textlen;
Karsten Hopp 9d3f37
+ 		pre_textlen -= getviscol2(oap->start.col, oap->start.coladd)
Karsten Hopp 9d3f37
+ 							    - oap->start_vcol;
Karsten Hopp 9d3f37
+ 		oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd);
Karsten Hopp 9d3f37
+ 		oap->op_type = OP_INSERT;
Karsten Hopp 9d3f37
+ 	    }
Karsten Hopp 9d3f37
+ 	}
Karsten Hopp 9d3f37
+ 
Karsten Hopp 9d3f37
  	/*
Karsten Hopp 9d3f37
  	 * Spaces and tabs in the indent may have changed to other spaces and
Karsten Hopp 9d3f37
  	 * tabs.  Get the starting column again and correct the length.
Karsten Hopp 9d3f37
*** ../vim-7.4.084/src/testdir/test39.in	2013-11-04 01:41:11.000000000 +0100
Karsten Hopp 9d3f37
--- src/testdir/test39.in	2013-11-11 01:20:51.000000000 +0100
Karsten Hopp 9d3f37
***************
Karsten Hopp 9d3f37
*** 19,24 ****
Karsten Hopp 9d3f37
--- 19,28 ----
Karsten Hopp 9d3f37
  :" Test block-change
Karsten Hopp 9d3f37
  G$khhh?hhkkcmno?
Karsten Hopp 9d3f37
  :$-4,$w! test.out
Karsten Hopp 9d3f37
+ :" Test block-insert using cursor keys for movement
Karsten Hopp 9d3f37
+ /^aaaa/
Karsten Hopp 9d3f37
+ :exe ":norm! l\<C-V>jjjlllI\<Right>\<Right>  \<Esc>"
Karsten Hopp 9d3f37
+ :/^aa/,/^$/w >> test.out
Karsten Hopp 9d3f37
  :" gUe must uppercase a whole word, also when ß changes to SS
Karsten Hopp 9d3f37
  Gothe youtußeuu end?Ypk0wgUe
Karsten Hopp 9d3f37
  :" gUfx must uppercase until x, inclusive.
Karsten Hopp 9d3f37
***************
Karsten Hopp 9d3f37
*** 40,45 ****
Karsten Hopp 9d3f37
--- 44,54 ----
Karsten Hopp 9d3f37
  :qa!
Karsten Hopp 9d3f37
  ENDTEST
Karsten Hopp 9d3f37
  
Karsten Hopp 9d3f37
+ aaaaaa
Karsten Hopp 9d3f37
+ bbbbbb
Karsten Hopp 9d3f37
+ cccccc
Karsten Hopp 9d3f37
+ dddddd
Karsten Hopp 9d3f37
+ 
Karsten Hopp 9d3f37
  abcdefghijklm
Karsten Hopp 9d3f37
  abcdefghijklm
Karsten Hopp 9d3f37
  abcdefghijklm
Karsten Hopp 9d3f37
*** ../vim-7.4.084/src/testdir/test39.ok	2013-11-04 01:41:11.000000000 +0100
Karsten Hopp 9d3f37
--- src/testdir/test39.ok	2013-11-11 01:20:51.000000000 +0100
Karsten Hopp 9d3f37
***************
Karsten Hopp 9d3f37
*** 3,8 ****
Karsten Hopp 9d3f37
--- 3,13 ----
Karsten Hopp 9d3f37
  axyzqqqqef mno        ghijklm
Karsten Hopp 9d3f37
  axyzqqqqefgmnoklm
Karsten Hopp 9d3f37
  abcdqqqqijklm
Karsten Hopp 9d3f37
+ aaa  aaa
Karsten Hopp 9d3f37
+ bbb  bbb
Karsten Hopp 9d3f37
+ ccc  ccc
Karsten Hopp 9d3f37
+ ddd  ddd
Karsten Hopp 9d3f37
+ 
Karsten Hopp 9d3f37
  the YOUTUSSEUU end
Karsten Hopp 9d3f37
  - yOUSSTUSSEXu -
Karsten Hopp 9d3f37
  THE YOUTUSSEUU END
Karsten Hopp 9d3f37
*** ../vim-7.4.084/src/version.c	2013-11-11 01:05:43.000000000 +0100
Karsten Hopp 9d3f37
--- src/version.c	2013-11-11 01:18:01.000000000 +0100
Karsten Hopp 9d3f37
***************
Karsten Hopp 9d3f37
*** 740,741 ****
Karsten Hopp 9d3f37
--- 740,743 ----
Karsten Hopp 9d3f37
  {   /* Add new patch number below this line */
Karsten Hopp 9d3f37
+ /**/
Karsten Hopp 9d3f37
+     85,
Karsten Hopp 9d3f37
  /**/
Karsten Hopp 9d3f37
Karsten Hopp 9d3f37
-- 
Karsten Hopp 9d3f37
SOLDIER: What?  Ridden on a horse?
Karsten Hopp 9d3f37
ARTHUR:  Yes!
Karsten Hopp 9d3f37
SOLDIER: You're using coconuts!
Karsten Hopp 9d3f37
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 9d3f37
Karsten Hopp 9d3f37
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 9d3f37
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 9d3f37
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 9d3f37
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///