lkundrak / rpms / vim

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