Blame SOURCES/7.4.187

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