jkunstle / rpms / vim

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