Karsten Hopp f4c9ab
To: vim_dev@googlegroups.com
Karsten Hopp f4c9ab
Subject: Patch 7.4.559
Karsten Hopp f4c9ab
Fcc: outbox
Karsten Hopp f4c9ab
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f4c9ab
Mime-Version: 1.0
Karsten Hopp f4c9ab
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f4c9ab
Content-Transfer-Encoding: 8bit
Karsten Hopp f4c9ab
------------
Karsten Hopp f4c9ab
Karsten Hopp f4c9ab
Patch 7.4.559
Karsten Hopp f4c9ab
Problem:    Appending a block in the middle of a tab does not work correctly
Karsten Hopp f4c9ab
	    when virtualedit is set.
Karsten Hopp f4c9ab
Solution:   Decrement spaces and count, don't reset them. (James McCoy)
Karsten Hopp f4c9ab
Files:	    src/ops.c, src/testdir/test39.in, src/testdir/test39.ok
Karsten Hopp f4c9ab
Karsten Hopp f4c9ab
Karsten Hopp f4c9ab
*** ../vim-7.4.558/src/ops.c	2014-11-19 17:35:35.081446695 +0100
Karsten Hopp f4c9ab
--- src/ops.c	2014-12-17 18:28:39.034973177 +0100
Karsten Hopp f4c9ab
***************
Karsten Hopp f4c9ab
*** 612,631 ****
Karsten Hopp f4c9ab
  #ifdef FEAT_MBYTE
Karsten Hopp f4c9ab
  	if (has_mbyte && spaces > 0)
Karsten Hopp f4c9ab
  	{
Karsten Hopp f4c9ab
  	    /* Avoid starting halfway a multi-byte character. */
Karsten Hopp f4c9ab
  	    if (b_insert)
Karsten Hopp f4c9ab
  	    {
Karsten Hopp f4c9ab
! 		int off = (*mb_head_off)(oldp, oldp + offset + spaces);
Karsten Hopp f4c9ab
! 		spaces -= off;
Karsten Hopp f4c9ab
! 		count -= off;
Karsten Hopp f4c9ab
  	    }
Karsten Hopp f4c9ab
  	    else
Karsten Hopp f4c9ab
  	    {
Karsten Hopp f4c9ab
! 		int off = (*mb_off_next)(oldp, oldp + offset);
Karsten Hopp f4c9ab
  		offset += off;
Karsten Hopp f4c9ab
- 		spaces = 0;
Karsten Hopp f4c9ab
- 		count = 0;
Karsten Hopp f4c9ab
  	    }
Karsten Hopp f4c9ab
  	}
Karsten Hopp f4c9ab
  #endif
Karsten Hopp f4c9ab
  
Karsten Hopp f4c9ab
--- 612,631 ----
Karsten Hopp f4c9ab
  #ifdef FEAT_MBYTE
Karsten Hopp f4c9ab
  	if (has_mbyte && spaces > 0)
Karsten Hopp f4c9ab
  	{
Karsten Hopp f4c9ab
+ 	    int off;
Karsten Hopp f4c9ab
+ 
Karsten Hopp f4c9ab
  	    /* Avoid starting halfway a multi-byte character. */
Karsten Hopp f4c9ab
  	    if (b_insert)
Karsten Hopp f4c9ab
  	    {
Karsten Hopp f4c9ab
! 		off = (*mb_head_off)(oldp, oldp + offset + spaces);
Karsten Hopp f4c9ab
  	    }
Karsten Hopp f4c9ab
  	    else
Karsten Hopp f4c9ab
  	    {
Karsten Hopp f4c9ab
! 		off = (*mb_off_next)(oldp, oldp + offset);
Karsten Hopp f4c9ab
  		offset += off;
Karsten Hopp f4c9ab
  	    }
Karsten Hopp f4c9ab
+ 	    spaces -= off;
Karsten Hopp f4c9ab
+ 	    count -= off;
Karsten Hopp f4c9ab
  	}
Karsten Hopp f4c9ab
  #endif
Karsten Hopp f4c9ab
  
Karsten Hopp f4c9ab
*** ../vim-7.4.558/src/testdir/test39.in	2014-12-17 14:36:10.363090985 +0100
Karsten Hopp f4c9ab
--- src/testdir/test39.in	2014-12-17 18:27:18.151974111 +0100
Karsten Hopp f4c9ab
***************
Karsten Hopp f4c9ab
*** 38,48 ****
Karsten Hopp f4c9ab
  /^C23$/
Karsten Hopp f4c9ab
  :exe ":norm! l\<C-V>j$hhAab\<Esc>"
Karsten Hopp f4c9ab
  :.,/^$/w >> test.out
Karsten Hopp f4c9ab
! :" Test for Visual block insert when virtualedit=all
Karsten Hopp f4c9ab
! :set ve=all
Karsten Hopp f4c9ab
  :/\t\tline
Karsten Hopp f4c9ab
  :exe ":norm! 07l\<C-V>jjIx\<Esc>"
Karsten Hopp f4c9ab
! :set ve=
Karsten Hopp f4c9ab
  :.,/^$/w >> test.out
Karsten Hopp f4c9ab
  :" gUe must uppercase a whole word, also when ß changes to SS
Karsten Hopp f4c9ab
  Gothe youtußeuu end?Ypk0wgUe
Karsten Hopp f4c9ab
--- 38,51 ----
Karsten Hopp f4c9ab
  /^C23$/
Karsten Hopp f4c9ab
  :exe ":norm! l\<C-V>j$hhAab\<Esc>"
Karsten Hopp f4c9ab
  :.,/^$/w >> test.out
Karsten Hopp f4c9ab
! :" Test for Visual block insert when virtualedit=all and utf-8 encoding
Karsten Hopp f4c9ab
! :set ve=all enc=utf-8
Karsten Hopp f4c9ab
  :/\t\tline
Karsten Hopp f4c9ab
  :exe ":norm! 07l\<C-V>jjIx\<Esc>"
Karsten Hopp f4c9ab
! :.,/^$/w >> test.out
Karsten Hopp f4c9ab
! :" Test for Visual block append when virtualedit=all
Karsten Hopp f4c9ab
! :exe ":norm! 012l\<C-v>jjAx\<Esc>"
Karsten Hopp f4c9ab
! :set ve= enc=latin1
Karsten Hopp f4c9ab
  :.,/^$/w >> test.out
Karsten Hopp f4c9ab
  :" gUe must uppercase a whole word, also when ß changes to SS
Karsten Hopp f4c9ab
  Gothe youtußeuu end?Ypk0wgUe
Karsten Hopp f4c9ab
*** ../vim-7.4.558/src/testdir/test39.ok	2014-08-16 18:13:00.082044726 +0200
Karsten Hopp f4c9ab
--- src/testdir/test39.ok	2014-12-17 18:18:33.090470463 +0100
Karsten Hopp f4c9ab
***************
Karsten Hopp f4c9ab
*** 26,31 ****
Karsten Hopp f4c9ab
--- 26,35 ----
Karsten Hopp f4c9ab
         x 	line2
Karsten Hopp f4c9ab
         x 	line3
Karsten Hopp f4c9ab
  
Karsten Hopp f4c9ab
+        x     x   line1
Karsten Hopp f4c9ab
+        x     x   line2
Karsten Hopp f4c9ab
+        x     x   line3
Karsten Hopp f4c9ab
+ 
Karsten Hopp f4c9ab
  the YOUTUSSEUU end
Karsten Hopp f4c9ab
  - yOUSSTUSSEXu -
Karsten Hopp f4c9ab
  THE YOUTUSSEUU END
Karsten Hopp f4c9ab
*** ../vim-7.4.558/src/version.c	2014-12-17 17:59:26.916631344 +0100
Karsten Hopp f4c9ab
--- src/version.c	2014-12-17 18:32:23.276199179 +0100
Karsten Hopp f4c9ab
***************
Karsten Hopp f4c9ab
*** 743,744 ****
Karsten Hopp f4c9ab
--- 743,746 ----
Karsten Hopp f4c9ab
  {   /* Add new patch number below this line */
Karsten Hopp f4c9ab
+ /**/
Karsten Hopp f4c9ab
+     559,
Karsten Hopp f4c9ab
  /**/
Karsten Hopp f4c9ab
Karsten Hopp f4c9ab
-- 
Karsten Hopp f4c9ab
hundred-and-one symptoms of being an internet addict:
Karsten Hopp f4c9ab
15. Your heart races faster and beats irregularly each time you see a new WWW
Karsten Hopp f4c9ab
    site address in print or on TV, even though you've never had heart
Karsten Hopp f4c9ab
    problems before.
Karsten Hopp f4c9ab
Karsten Hopp f4c9ab
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f4c9ab
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f4c9ab
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp f4c9ab
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///