lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
94ae6b8
To: vim_dev@googlegroups.com
94ae6b8
Subject: Patch 7.4.269
94ae6b8
Fcc: outbox
94ae6b8
From: Bram Moolenaar <Bram@moolenaar.net>
94ae6b8
Mime-Version: 1.0
94ae6b8
Content-Type: text/plain; charset=UTF-8
94ae6b8
Content-Transfer-Encoding: 8bit
94ae6b8
------------
94ae6b8
94ae6b8
Patch 7.4.269
94ae6b8
Problem:    CTRL-U in Insert mode does not work after using a cursor key.
94ae6b8
	    (Pine Wu)
94ae6b8
Solution:   Use the original insert start position. (Christian Brabandt)
94ae6b8
Files:	    src/edit.c, src/testdir/test29.in, src/testdir/test29.ok
94ae6b8
94ae6b8
94ae6b8
*** ../vim-7.4.268/src/edit.c	2014-04-29 12:15:22.852032651 +0200
94ae6b8
--- src/edit.c	2014-04-29 14:44:07.867876234 +0200
94ae6b8
***************
94ae6b8
*** 8760,8767 ****
94ae6b8
  		((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
94ae6b8
  		    || (!can_bs(BS_START)
94ae6b8
  			&& (arrow_used
94ae6b8
! 			    || (curwin->w_cursor.lnum == Insstart.lnum
94ae6b8
! 				&& curwin->w_cursor.col <= Insstart.col)))
94ae6b8
  		    || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
94ae6b8
  					 && curwin->w_cursor.col <= ai_col)
94ae6b8
  		    || (!can_bs(BS_EOL) && curwin->w_cursor.col == 0))))
94ae6b8
--- 8760,8767 ----
94ae6b8
  		((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
94ae6b8
  		    || (!can_bs(BS_START)
94ae6b8
  			&& (arrow_used
94ae6b8
! 			    || (curwin->w_cursor.lnum == Insstart_orig.lnum
94ae6b8
! 				&& curwin->w_cursor.col <= Insstart_orig.col)))
94ae6b8
  		    || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
94ae6b8
  					 && curwin->w_cursor.col <= ai_col)
94ae6b8
  		    || (!can_bs(BS_EOL) && curwin->w_cursor.col == 0))))
94ae6b8
***************
94ae6b8
*** 8812,8819 ****
94ae6b8
       */
94ae6b8
      if (curwin->w_cursor.col == 0)
94ae6b8
      {
94ae6b8
! 	lnum = Insstart.lnum;
94ae6b8
! 	if (curwin->w_cursor.lnum == Insstart.lnum
94ae6b8
  #ifdef FEAT_RIGHTLEFT
94ae6b8
  			|| revins_on
94ae6b8
  #endif
94ae6b8
--- 8812,8819 ----
94ae6b8
       */
94ae6b8
      if (curwin->w_cursor.col == 0)
94ae6b8
      {
94ae6b8
! 	lnum = Insstart_orig.lnum;
94ae6b8
! 	if (curwin->w_cursor.lnum == lnum
94ae6b8
  #ifdef FEAT_RIGHTLEFT
94ae6b8
  			|| revins_on
94ae6b8
  #endif
94ae6b8
***************
94ae6b8
*** 8822,8829 ****
94ae6b8
  	    if (u_save((linenr_T)(curwin->w_cursor.lnum - 2),
94ae6b8
  			       (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
94ae6b8
  		return FALSE;
94ae6b8
! 	    --Insstart.lnum;
94ae6b8
! 	    Insstart.col = MAXCOL;
94ae6b8
  	}
94ae6b8
  	/*
94ae6b8
  	 * In replace mode:
94ae6b8
--- 8822,8829 ----
94ae6b8
  	    if (u_save((linenr_T)(curwin->w_cursor.lnum - 2),
94ae6b8
  			       (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
94ae6b8
  		return FALSE;
94ae6b8
! 	    --Insstart_orig.lnum;
94ae6b8
! 	    Insstart_orig.col = MAXCOL;
94ae6b8
  	}
94ae6b8
  	/*
94ae6b8
  	 * In replace mode:
94ae6b8
***************
94ae6b8
*** 8981,8989 ****
94ae6b8
  	    while (vcol < want_vcol)
94ae6b8
  	    {
94ae6b8
  		/* Remember the first char we inserted */
94ae6b8
! 		if (curwin->w_cursor.lnum == Insstart.lnum
94ae6b8
! 				   && curwin->w_cursor.col < Insstart.col)
94ae6b8
! 		    Insstart.col = curwin->w_cursor.col;
94ae6b8
  
94ae6b8
  #ifdef FEAT_VREPLACE
94ae6b8
  		if (State & VREPLACE_FLAG)
94ae6b8
--- 8981,8989 ----
94ae6b8
  	    while (vcol < want_vcol)
94ae6b8
  	    {
94ae6b8
  		/* Remember the first char we inserted */
94ae6b8
! 		if (curwin->w_cursor.lnum == Insstart_orig.lnum
94ae6b8
! 				   && curwin->w_cursor.col < Insstart_orig.col)
94ae6b8
! 		    Insstart_orig.col = curwin->w_cursor.col;
94ae6b8
  
94ae6b8
  #ifdef FEAT_VREPLACE
94ae6b8
  		if (State & VREPLACE_FLAG)
94ae6b8
***************
94ae6b8
*** 9071,9078 ****
94ae6b8
  		revins_on ||
94ae6b8
  #endif
94ae6b8
  		(curwin->w_cursor.col > mincol
94ae6b8
! 		 && (curwin->w_cursor.lnum != Insstart.lnum
94ae6b8
! 		     || curwin->w_cursor.col != Insstart.col)));
94ae6b8
  	did_backspace = TRUE;
94ae6b8
      }
94ae6b8
  #ifdef FEAT_SMARTINDENT
94ae6b8
--- 9071,9078 ----
94ae6b8
  		revins_on ||
94ae6b8
  #endif
94ae6b8
  		(curwin->w_cursor.col > mincol
94ae6b8
! 		 && (curwin->w_cursor.lnum != Insstart_orig.lnum
94ae6b8
! 		     || curwin->w_cursor.col != Insstart_orig.col)));
94ae6b8
  	did_backspace = TRUE;
94ae6b8
      }
94ae6b8
  #ifdef FEAT_SMARTINDENT
94ae6b8
***************
94ae6b8
*** 9090,9098 ****
94ae6b8
      AppendCharToRedobuff(c);
94ae6b8
  
94ae6b8
      /* If deleted before the insertion point, adjust it */
94ae6b8
!     if (curwin->w_cursor.lnum == Insstart.lnum
94ae6b8
! 				       && curwin->w_cursor.col < Insstart.col)
94ae6b8
! 	Insstart.col = curwin->w_cursor.col;
94ae6b8
  
94ae6b8
      /* vi behaviour: the cursor moves backward but the character that
94ae6b8
       *		     was there remains visible
94ae6b8
--- 9090,9098 ----
94ae6b8
      AppendCharToRedobuff(c);
94ae6b8
  
94ae6b8
      /* If deleted before the insertion point, adjust it */
94ae6b8
!     if (curwin->w_cursor.lnum == Insstart_orig.lnum
94ae6b8
! 				       && curwin->w_cursor.col < Insstart_orig.col)
94ae6b8
! 	Insstart_orig.col = curwin->w_cursor.col;
94ae6b8
  
94ae6b8
      /* vi behaviour: the cursor moves backward but the character that
94ae6b8
       *		     was there remains visible
94ae6b8
*** ../vim-7.4.268/src/testdir/test29.in	2012-06-13 13:48:26.000000000 +0200
94ae6b8
--- src/testdir/test29.in	2014-04-29 14:31:23.619889628 +0200
94ae6b8
***************
94ae6b8
*** 102,107 ****
94ae6b8
--- 102,135 ----
94ae6b8
  }
94ae6b8
  
94ae6b8
  STARTTEST
94ae6b8
+ :" Test with backspace set to the non-compatible setting
94ae6b8
+ /^\d\+ this
94ae6b8
+ :set cp bs=2
94ae6b8
+ Avim1??
94ae6b8
+ Avim2?u??
94ae6b8
+ :set cpo-=<
94ae6b8
+ :inoremap <c-u> <left><c-u>
94ae6b8
+ Avim3??
94ae6b8
+ :iunmap <c-u>
94ae6b8
+ Avim4???
94ae6b8
+ :" Test with backspace set to the compatible setting
94ae6b8
+ :set bs=
94ae6b8
+ A vim5?A???
94ae6b8
+ A vim6?Azwei?u??
94ae6b8
+ :inoremap <c-u> <left><c-u>
94ae6b8
+ A vim7???
94ae6b8
+ :set cp
94ae6b8
+ ENDTEST
94ae6b8
+ 1 this shouldn't be deleted
94ae6b8
+ 2 this shouldn't be deleted
94ae6b8
+ 3 this shouldn't be deleted
94ae6b8
+ 4 this should be deleted
94ae6b8
+ 5 this shouldn't be deleted
94ae6b8
+ 6 this shouldn't be deleted
94ae6b8
+ 7 this shouldn't be deleted
94ae6b8
+ 8 this shouldn't be deleted (not touched yet)
94ae6b8
+ 
94ae6b8
+ STARTTEST
94ae6b8
  /^{/+1
94ae6b8
  :set comments=sO:*\ -,mO:*\ \ ,exO:*/
94ae6b8
  :set comments+=s1:/*,mb:*,ex:*/,://
94ae6b8
*** ../vim-7.4.268/src/testdir/test29.ok	2012-06-13 13:48:26.000000000 +0200
94ae6b8
--- src/testdir/test29.ok	2014-04-29 14:31:23.623889628 +0200
94ae6b8
***************
94ae6b8
*** 62,67 ****
94ae6b8
--- 62,76 ----
94ae6b8
      action();
94ae6b8
  }
94ae6b8
  
94ae6b8
+ 1 this shouldn't be deleted
94ae6b8
+ 2 this shouldn't be deleted
94ae6b8
+ 3 this shouldn't be deleted
94ae6b8
+ 4 this should be deleted3
94ae6b8
+ 
94ae6b8
+ 6 this shouldn't be deleted vim5
94ae6b8
+ 7 this shouldn't be deleted vim6
94ae6b8
+ 8 this shouldn't be deleted (not touched yet) vim7
94ae6b8
+ 
94ae6b8
  
94ae6b8
  {
94ae6b8
  /* Make sure the previous comment leader is not removed.  */
94ae6b8
*** ../vim-7.4.268/src/version.c	2014-04-29 14:02:42.547919791 +0200
94ae6b8
--- src/version.c	2014-04-29 14:42:09.083878315 +0200
94ae6b8
***************
94ae6b8
*** 736,737 ****
94ae6b8
--- 736,739 ----
94ae6b8
  {   /* Add new patch number below this line */
94ae6b8
+ /**/
94ae6b8
+     269,
94ae6b8
  /**/
94ae6b8
94ae6b8
-- 
94ae6b8
From "know your smileys":
94ae6b8
 [:-)	Frankenstein's monster
94ae6b8
94ae6b8
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
94ae6b8
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
94ae6b8
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
94ae6b8
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///