073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.187
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.187
073263
Problem:    Delete that crosses line break splits multi-byte character.
073263
Solution:   Advance a character instead of a byte. (Cade Foster)
073263
Files:      src/normal.c, src/testdir/test69.in, src/testdir/test69.ok
073263
073263
073263
*** ../vim-7.4.186/src/normal.c	2014-02-11 15:10:38.134111836 +0100
073263
--- src/normal.c	2014-02-22 23:41:12.472897635 +0100
073263
***************
073263
*** 21,27 ****
073263
  static int	resel_VIsual_mode = NUL;	/* 'v', 'V', or Ctrl-V */
073263
  static linenr_T	resel_VIsual_line_count;	/* number of lines */
073263
  static colnr_T	resel_VIsual_vcol;		/* nr of cols or end col */
073263
! static int	VIsual_mode_orig = NUL;         /* type of Visual mode, that user entered */
073263
  
073263
  static int	restart_VIsual_select = 0;
073263
  #endif
073263
--- 21,27 ----
073263
  static int	resel_VIsual_mode = NUL;	/* 'v', 'V', or Ctrl-V */
073263
  static linenr_T	resel_VIsual_line_count;	/* number of lines */
073263
  static colnr_T	resel_VIsual_vcol;		/* nr of cols or end col */
073263
! static int	VIsual_mode_orig = NUL;		/* saved Visual mode */
073263
  
073263
  static int	restart_VIsual_select = 0;
073263
  #endif
073263
***************
073263
*** 6202,6209 ****
073263
  			    || cap->oap->op_type == OP_CHANGE)
073263
  			&& !lineempty(curwin->w_cursor.lnum))
073263
  		{
073263
! 		    if (*ml_get_cursor() != NUL)
073263
! 			++curwin->w_cursor.col;
073263
  		    cap->retval |= CA_NO_ADJ_OP_END;
073263
  		}
073263
  		continue;
073263
--- 6202,6218 ----
073263
  			    || cap->oap->op_type == OP_CHANGE)
073263
  			&& !lineempty(curwin->w_cursor.lnum))
073263
  		{
073263
! 		    char_u *cp = ml_get_cursor();
073263
! 
073263
! 		    if (*cp != NUL)
073263
! 		    {
073263
! #ifdef FEAT_MBYTE
073263
! 			if (has_mbyte)
073263
! 			    curwin->w_cursor.col += (*mb_ptr2len)(cp);
073263
! 			else
073263
! #endif
073263
! 			    ++curwin->w_cursor.col;
073263
! 		    }
073263
  		    cap->retval |= CA_NO_ADJ_OP_END;
073263
  		}
073263
  		continue;
073263
***************
073263
*** 9482,9488 ****
073263
  # ifdef FEAT_CLIPBOARD
073263
  	    adjust_clip_reg(&regname);
073263
  # endif
073263
!            if (regname == 0 || regname == '"'
073263
  				     || VIM_ISDIGIT(regname) || regname == '-'
073263
  # ifdef FEAT_CLIPBOARD
073263
  		    || (clip_unnamed && (regname == '*' || regname == '+'))
073263
--- 9491,9497 ----
073263
  # ifdef FEAT_CLIPBOARD
073263
  	    adjust_clip_reg(&regname);
073263
  # endif
073263
! 	   if (regname == 0 || regname == '"'
073263
  				     || VIM_ISDIGIT(regname) || regname == '-'
073263
  # ifdef FEAT_CLIPBOARD
073263
  		    || (clip_unnamed && (regname == '*' || regname == '+'))
073263
*** ../vim-7.4.186/src/testdir/test69.in	2013-11-02 23:29:17.000000000 +0100
073263
--- src/testdir/test69.in	2014-02-22 23:38:50.508897861 +0100
073263
***************
073263
*** 155,160 ****
073263
--- 155,170 ----
073263
  aab
073263
  
073263
  STARTTEST
073263
+ :set whichwrap+=h
073263
+ /^x
073263
+ dh
073263
+ :set whichwrap-=h
073263
+ ENDTEST
073263
+ 
073263
+ á
073263
+ x
073263
+ 
073263
+ STARTTEST
073263
  :let a = '.é.' " one char of two bytes
073263
  :let b = '.é.' " normal e with composing char
073263
  /^byteidx
073263
*** ../vim-7.4.186/src/testdir/test69.ok	2013-11-02 23:29:17.000000000 +0100
073263
--- src/testdir/test69.ok	2014-02-22 23:38:53.752897856 +0100
073263
***************
073263
*** 150,155 ****
073263
--- 150,158 ----
073263
  aaa
073263
  
073263
  
073263
+ áx
073263
+ 
073263
+ 
073263
  byteidx
073263
  [0, 1, 3, 4, -1]
073263
  [0, 1, 4, 5, -1]
073263
*** ../vim-7.4.186/src/version.c	2014-02-22 23:03:48.716901208 +0100
073263
--- src/version.c	2014-02-22 23:30:24.412898667 +0100
073263
***************
073263
*** 740,741 ****
073263
--- 740,743 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     187,
073263
  /**/
073263
073263
-- 
073263
ARTHUR:  Then who is your lord?
073263
WOMAN:   We don't have a lord.
073263
ARTHUR:  What?
073263
DENNIS:  I told you.  We're an anarcho-syndicalist commune.  We take it in
073263
         turns to act as a sort of executive officer for the week.
073263
                                  The Quest for the Holy Grail (Monty Python)
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    ///