Karsten Hopp c76948
To: vim_dev@googlegroups.com
Karsten Hopp c76948
Subject: Patch 7.4.408
Karsten Hopp c76948
Fcc: outbox
Karsten Hopp c76948
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c76948
Mime-Version: 1.0
Karsten Hopp c76948
Content-Type: text/plain; charset=UTF-8
Karsten Hopp c76948
Content-Transfer-Encoding: 8bit
Karsten Hopp c76948
------------
Karsten Hopp c76948
Karsten Hopp c76948
Patch 7.4.408
Karsten Hopp c76948
Problem:    Visual block insert breaks a multi-byte character.
Karsten Hopp c76948
Solution:   Calculate the position properly. (Yasuhiro Matsumoto)
Karsten Hopp c76948
Files:	    src/ops.c, src/testdir/test_utf8.in, src/testdir/test_utf8.ok,
Karsten Hopp c76948
	    src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak,
Karsten Hopp c76948
	    src/testdir/Make_ming.mak, src/testdir/Make_os2.mak,
Karsten Hopp c76948
	    src/testdir/Make_vms.mms, src/testdir/Makefile
Karsten Hopp c76948
Karsten Hopp c76948
Karsten Hopp c76948
*** ../vim-7.4.407/src/ops.c	2014-08-06 18:17:03.475147780 +0200
Karsten Hopp c76948
--- src/ops.c	2014-08-16 18:33:34.625999952 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 609,614 ****
Karsten Hopp c76948
--- 609,634 ----
Karsten Hopp c76948
  	    }
Karsten Hopp c76948
  	}
Karsten Hopp c76948
  
Karsten Hopp c76948
+ #ifdef FEAT_MBYTE
Karsten Hopp c76948
+ 	if (has_mbyte && spaces > 0)
Karsten Hopp c76948
+ 	{
Karsten Hopp c76948
+ 	    /* Avoid starting halfway a multi-byte character. */
Karsten Hopp c76948
+ 	    if (b_insert)
Karsten Hopp c76948
+ 	    {
Karsten Hopp c76948
+ 		int off = (*mb_head_off)(oldp, oldp + offset + spaces);
Karsten Hopp c76948
+ 		spaces -= off;
Karsten Hopp c76948
+ 		count -= off;
Karsten Hopp c76948
+ 	    }
Karsten Hopp c76948
+ 	    else
Karsten Hopp c76948
+ 	    {
Karsten Hopp c76948
+ 		int off = (*mb_off_next)(oldp, oldp + offset);
Karsten Hopp c76948
+ 		offset += off;
Karsten Hopp c76948
+ 		spaces = 0;
Karsten Hopp c76948
+ 		count = 0;
Karsten Hopp c76948
+ 	    }
Karsten Hopp c76948
+ 	}
Karsten Hopp c76948
+ #endif
Karsten Hopp c76948
+ 
Karsten Hopp c76948
  	newp = alloc_check((unsigned)(STRLEN(oldp)) + s_len + count + 1);
Karsten Hopp c76948
  	if (newp == NULL)
Karsten Hopp c76948
  	    continue;
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/test_utf8.in	2014-08-16 18:35:44.853995229 +0200
Karsten Hopp c76948
--- src/testdir/test_utf8.in	2014-08-16 18:25:02.310018533 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 0 ****
Karsten Hopp c76948
--- 1,18 ----
Karsten Hopp c76948
+ Tests for Unicode manipulations                vim: set ft=vim :
Karsten Hopp c76948
+  
Karsten Hopp c76948
+ STARTTEST
Karsten Hopp c76948
+ :so small.vim
Karsten Hopp c76948
+ :set encoding=utf-8
Karsten Hopp c76948
+ :" Visual block Insert adjusts for multi-byte char
Karsten Hopp c76948
+ :new
Karsten Hopp c76948
+ :call setline(1, ["aaa", "あああ", "bbb"])
Karsten Hopp c76948
+ :exe ":norm! gg0l\<C-V>jjIx\<Esc>"
Karsten Hopp c76948
+ :let r = getline(1, '$')
Karsten Hopp c76948
+ :
Karsten Hopp c76948
+ :bwipeout!
Karsten Hopp c76948
+ :$put=r
Karsten Hopp c76948
+ :call garbagecollect(1)
Karsten Hopp c76948
+ :/^start:/,$wq! test.out
Karsten Hopp c76948
+ ENDTEST
Karsten Hopp c76948
+  
Karsten Hopp c76948
+ start:
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/test_utf8.ok	2014-08-16 18:35:44.857995229 +0200
Karsten Hopp c76948
--- src/testdir/test_utf8.ok	2014-08-16 18:25:35.354017334 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 0 ****
Karsten Hopp c76948
--- 1,4 ----
Karsten Hopp c76948
+ start:
Karsten Hopp c76948
+ axaa
Karsten Hopp c76948
+ xあああ
Karsten Hopp c76948
+ bxbb
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/Make_amiga.mak	2014-07-30 16:00:45.547553496 +0200
Karsten Hopp c76948
--- src/testdir/Make_amiga.mak	2014-08-16 18:28:17.694011447 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 38,50 ****
Karsten Hopp c76948
  		test104.out test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
- 		test_listlbr.out \
Karsten Hopp c76948
- 		test_listlbr_utf8.out \
Karsten Hopp c76948
- 		test_qf_title.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_options.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  .SUFFIXES: .in .out
Karsten Hopp c76948
  
Karsten Hopp c76948
--- 38,51 ----
Karsten Hopp c76948
  		test104.out test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_listlbr.out \
Karsten Hopp c76948
! 		test_listlbr_utf8.out \
Karsten Hopp c76948
! 		test_options.out \
Karsten Hopp c76948
! 		test_qf_title.out \
Karsten Hopp c76948
! 		test_utf8.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  .SUFFIXES: .in .out
Karsten Hopp c76948
  
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 170,179 ****
Karsten Hopp c76948
  test107.out: test107.in
Karsten Hopp c76948
  test_autoformat_join.out: test_autoformat_join.in
Karsten Hopp c76948
  test_breakindent.out: test_breakindent.in
Karsten Hopp c76948
- test_listlbr.out: test_listlbr.in
Karsten Hopp c76948
- test_listlbr_utf8.out: test_listlbr_utf8.in
Karsten Hopp c76948
- test_qf_title.out: test_qf_title.in
Karsten Hopp c76948
  test_changelist.out: test_changelist.in
Karsten Hopp c76948
  test_eval.out: test_eval.in
Karsten Hopp c76948
  test_insertcount.out: test_insertcount.in
Karsten Hopp c76948
  test_options.out: test_options.in
Karsten Hopp c76948
--- 171,181 ----
Karsten Hopp c76948
  test107.out: test107.in
Karsten Hopp c76948
  test_autoformat_join.out: test_autoformat_join.in
Karsten Hopp c76948
  test_breakindent.out: test_breakindent.in
Karsten Hopp c76948
  test_changelist.out: test_changelist.in
Karsten Hopp c76948
  test_eval.out: test_eval.in
Karsten Hopp c76948
  test_insertcount.out: test_insertcount.in
Karsten Hopp c76948
+ test_listlbr.out: test_listlbr.in
Karsten Hopp c76948
+ test_listlbr_utf8.out: test_listlbr_utf8.in
Karsten Hopp c76948
  test_options.out: test_options.in
Karsten Hopp c76948
+ test_qf_title.out: test_qf_title.in
Karsten Hopp c76948
+ test_utf8.out: test_utf8.in
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/Make_dos.mak	2014-07-30 16:00:45.547553496 +0200
Karsten Hopp c76948
--- src/testdir/Make_dos.mak	2014-08-16 18:28:37.122010742 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 37,49 ****
Karsten Hopp c76948
  		test105.out test106.out  test107.out\
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
- 		test_listlbr.out \
Karsten Hopp c76948
- 		test_listlbr_utf8.out \
Karsten Hopp c76948
- 		test_qf_title.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_options.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp c76948
  
Karsten Hopp c76948
--- 37,50 ----
Karsten Hopp c76948
  		test105.out test106.out  test107.out\
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_listlbr.out \
Karsten Hopp c76948
! 		test_listlbr_utf8.out \
Karsten Hopp c76948
! 		test_options.out \
Karsten Hopp c76948
! 		test_qf_title.out \
Karsten Hopp c76948
! 		test_utf8.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp c76948
  
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/Make_ming.mak	2014-07-30 16:00:45.547553496 +0200
Karsten Hopp c76948
--- src/testdir/Make_ming.mak	2014-08-16 18:28:56.438010041 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 57,69 ****
Karsten Hopp c76948
  		test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
- 		test_listlbr.out \
Karsten Hopp c76948
- 		test_listlbr_utf8.out \
Karsten Hopp c76948
- 		test_qf_title.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_options.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp c76948
  
Karsten Hopp c76948
--- 57,70 ----
Karsten Hopp c76948
  		test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_listlbr.out \
Karsten Hopp c76948
! 		test_listlbr_utf8.out \
Karsten Hopp c76948
! 		test_options.out \
Karsten Hopp c76948
! 		test_qf_title.out \
Karsten Hopp c76948
! 		test_utf8.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  SCRIPTS32 =	test50.out test70.out
Karsten Hopp c76948
  
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/Make_os2.mak	2014-07-30 16:00:45.547553496 +0200
Karsten Hopp c76948
--- src/testdir/Make_os2.mak	2014-08-16 18:29:26.962008934 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 38,51 ****
Karsten Hopp c76948
  		test100.out test101.out test102.out test103.out test104.out \
Karsten Hopp c76948
  		test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
- 		test_breakindent.out \
Karsten Hopp c76948
  		test_listlbr.out \
Karsten Hopp c76948
  		test_listlbr_utf8.out \
Karsten Hopp c76948
  		test_qf_title.out \
Karsten Hopp c76948
! 		test_options.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  .SUFFIXES: .in .out
Karsten Hopp c76948
  
Karsten Hopp c76948
--- 38,52 ----
Karsten Hopp c76948
  		test100.out test101.out test102.out test103.out test104.out \
Karsten Hopp c76948
  		test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
+ 		test_breakindent.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
  		test_listlbr.out \
Karsten Hopp c76948
  		test_listlbr_utf8.out \
Karsten Hopp c76948
+ 		test_options.out \
Karsten Hopp c76948
  		test_qf_title.out \
Karsten Hopp c76948
! 		test_utf8.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  .SUFFIXES: .in .out
Karsten Hopp c76948
  
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/Make_vms.mms	2014-07-30 16:00:45.547553496 +0200
Karsten Hopp c76948
--- src/testdir/Make_vms.mms	2014-08-16 18:29:42.702008364 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 4,10 ****
Karsten Hopp c76948
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp c76948
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp c76948
  #
Karsten Hopp c76948
! # Last change:  2014 Jul 30
Karsten Hopp c76948
  #
Karsten Hopp c76948
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp c76948
  # Edit the lines in the Configuration section below to select.
Karsten Hopp c76948
--- 4,10 ----
Karsten Hopp c76948
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp c76948
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp c76948
  #
Karsten Hopp c76948
! # Last change:  2014 Aug 16
Karsten Hopp c76948
  #
Karsten Hopp c76948
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp c76948
  # Edit the lines in the Configuration section below to select.
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 98,110 ****
Karsten Hopp c76948
  	 test105.out test106.out test107.out \
Karsten Hopp c76948
  	 test_autoformat_join.out \
Karsten Hopp c76948
  	 test_breakindent.out \
Karsten Hopp c76948
- 	 test_listlbr.out \
Karsten Hopp c76948
- 	 test_listlbr_utf8.out \
Karsten Hopp c76948
- 	 test_qf_title.out \
Karsten Hopp c76948
  	 test_changelist.out \
Karsten Hopp c76948
  	 test_eval.out \
Karsten Hopp c76948
  	 test_insertcount.out \
Karsten Hopp c76948
! 	 test_options.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  # Known problems:
Karsten Hopp c76948
  # test17: ?
Karsten Hopp c76948
--- 98,111 ----
Karsten Hopp c76948
  	 test105.out test106.out test107.out \
Karsten Hopp c76948
  	 test_autoformat_join.out \
Karsten Hopp c76948
  	 test_breakindent.out \
Karsten Hopp c76948
  	 test_changelist.out \
Karsten Hopp c76948
  	 test_eval.out \
Karsten Hopp c76948
  	 test_insertcount.out \
Karsten Hopp c76948
! 	 test_listlbr.out \
Karsten Hopp c76948
! 	 test_listlbr_utf8.out \
Karsten Hopp c76948
! 	 test_options.out \
Karsten Hopp c76948
! 	 test_qf_title.out \
Karsten Hopp c76948
! 	 test_utf8.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  # Known problems:
Karsten Hopp c76948
  # test17: ?
Karsten Hopp c76948
*** ../vim-7.4.407/src/testdir/Makefile	2014-07-30 16:00:45.547553496 +0200
Karsten Hopp c76948
--- src/testdir/Makefile	2014-08-16 18:30:13.254007256 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 35,47 ****
Karsten Hopp c76948
  		test104.out test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
- 		test_listlbr.out \
Karsten Hopp c76948
- 		test_listlbr_utf8.out \
Karsten Hopp c76948
- 		test_qf_title.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_options.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  SCRIPTS_GUI = test16.out
Karsten Hopp c76948
  
Karsten Hopp c76948
--- 35,48 ----
Karsten Hopp c76948
  		test104.out test105.out test106.out test107.out \
Karsten Hopp c76948
  		test_autoformat_join.out \
Karsten Hopp c76948
  		test_breakindent.out \
Karsten Hopp c76948
  		test_changelist.out \
Karsten Hopp c76948
  		test_eval.out \
Karsten Hopp c76948
  		test_insertcount.out \
Karsten Hopp c76948
! 		test_listlbr.out \
Karsten Hopp c76948
! 		test_listlbr_utf8.out \
Karsten Hopp c76948
! 		test_options.out \
Karsten Hopp c76948
! 		test_qf_title.out \
Karsten Hopp c76948
! 		test_utf8.out
Karsten Hopp c76948
  
Karsten Hopp c76948
  SCRIPTS_GUI = test16.out
Karsten Hopp c76948
  
Karsten Hopp c76948
*** ../vim-7.4.407/src/version.c	2014-08-16 18:13:00.082044726 +0200
Karsten Hopp c76948
--- src/version.c	2014-08-16 18:35:52.937994936 +0200
Karsten Hopp c76948
***************
Karsten Hopp c76948
*** 743,744 ****
Karsten Hopp c76948
--- 743,746 ----
Karsten Hopp c76948
  {   /* Add new patch number below this line */
Karsten Hopp c76948
+ /**/
Karsten Hopp c76948
+     408,
Karsten Hopp c76948
  /**/
Karsten Hopp c76948
Karsten Hopp c76948
-- 
Karsten Hopp c76948
What a wonderfully exciting cough!  Do you mind if I join you?
Karsten Hopp c76948
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
Karsten Hopp c76948
Karsten Hopp c76948
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c76948
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c76948
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp c76948
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///