073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.559
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.559
073263
Problem:    Appending a block in the middle of a tab does not work correctly
073263
	    when virtualedit is set.
073263
Solution:   Decrement spaces and count, don't reset them. (James McCoy)
073263
Files:	    src/ops.c, src/testdir/test39.in, src/testdir/test39.ok
073263
073263
073263
*** ../vim-7.4.558/src/ops.c	2014-11-19 17:35:35.081446695 +0100
073263
--- src/ops.c	2014-12-17 18:28:39.034973177 +0100
073263
***************
073263
*** 612,631 ****
073263
  #ifdef FEAT_MBYTE
073263
  	if (has_mbyte && spaces > 0)
073263
  	{
073263
  	    /* Avoid starting halfway a multi-byte character. */
073263
  	    if (b_insert)
073263
  	    {
073263
! 		int off = (*mb_head_off)(oldp, oldp + offset + spaces);
073263
! 		spaces -= off;
073263
! 		count -= off;
073263
  	    }
073263
  	    else
073263
  	    {
073263
! 		int off = (*mb_off_next)(oldp, oldp + offset);
073263
  		offset += off;
073263
- 		spaces = 0;
073263
- 		count = 0;
073263
  	    }
073263
  	}
073263
  #endif
073263
  
073263
--- 612,631 ----
073263
  #ifdef FEAT_MBYTE
073263
  	if (has_mbyte && spaces > 0)
073263
  	{
073263
+ 	    int off;
073263
+ 
073263
  	    /* Avoid starting halfway a multi-byte character. */
073263
  	    if (b_insert)
073263
  	    {
073263
! 		off = (*mb_head_off)(oldp, oldp + offset + spaces);
073263
  	    }
073263
  	    else
073263
  	    {
073263
! 		off = (*mb_off_next)(oldp, oldp + offset);
073263
  		offset += off;
073263
  	    }
073263
+ 	    spaces -= off;
073263
+ 	    count -= off;
073263
  	}
073263
  #endif
073263
  
073263
*** ../vim-7.4.558/src/testdir/test39.ok	2014-08-16 18:13:00.082044726 +0200
073263
--- src/testdir/test39.ok	2014-12-17 18:18:33.090470463 +0100
073263
***************
073263
*** 26,31 ****
073263
--- 26,35 ----
073263
         x 	line2
073263
         x 	line3
073263
  
073263
+        x     x   line1
073263
+        x     x   line2
073263
+        x     x   line3
073263
+ 
073263
  the YOUTUSSEUU end
073263
  - yOUSSTUSSEXu -
073263
  THE YOUTUSSEUU END
073263
*** ../vim-7.4.558/src/version.c	2014-12-17 17:59:26.916631344 +0100
073263
--- src/version.c	2014-12-17 18:32:23.276199179 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     559,
073263
  /**/
073263
073263
-- 
073263
hundred-and-one symptoms of being an internet addict:
073263
15. Your heart races faster and beats irregularly each time you see a new WWW
073263
    site address in print or on TV, even though you've never had heart
073263
    problems before.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///