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