3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.490
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.490
3ef2ca
Problem:    Cannot specify the buffer to use for "do" and "dp", making them
3ef2ca
	    useless for three-way diff.
3ef2ca
Solution:   Use the count as the buffer number. (James McCoy)
3ef2ca
Files:	    runtime/doc/diff.txt, src/diff.c, src/normal.c, src/proto/diff.pro
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.489/runtime/doc/diff.txt	2013-08-10 13:24:52.000000000 +0200
3ef2ca
--- runtime/doc/diff.txt	2014-10-31 13:39:22.443236141 +0100
3ef2ca
***************
3ef2ca
*** 95,101 ****
3ef2ca
  :difft[his]	Make the current window part of the diff windows.  This sets
3ef2ca
  		the options like for "vimdiff".
3ef2ca
  
3ef2ca
! :diffp[atch] {patchfile}				 *E816* *:diffp* *:diffpatch*
3ef2ca
  		Use the current buffer, patch it with the diff found in
3ef2ca
  		{patchfile} and open a buffer on the result.  The options are
3ef2ca
  		set as for "vimdiff".
3ef2ca
--- 95,101 ----
3ef2ca
  :difft[his]	Make the current window part of the diff windows.  This sets
3ef2ca
  		the options like for "vimdiff".
3ef2ca
  
3ef2ca
! :diffp[atch] {patchfile}			 *E816* *:diffp* *:diffpatch*
3ef2ca
  		Use the current buffer, patch it with the diff found in
3ef2ca
  		{patchfile} and open a buffer on the result.  The options are
3ef2ca
  		set as for "vimdiff".
3ef2ca
***************
3ef2ca
*** 123,132 ****
3ef2ca
  file for a moment and come back to the same file and be in diff mode again.
3ef2ca
  
3ef2ca
  							*:diffo* *:diffoff*
3ef2ca
! :diffo[ff]	Switch off diff mode for the current window.
3ef2ca
  
3ef2ca
  :diffo[ff]!	Switch off diff mode for the current window and in all windows
3ef2ca
! 		in the current tab page where 'diff' is set.
3ef2ca
  
3ef2ca
  The ":diffoff" command resets the relevant options to the values they had when
3ef2ca
  using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode.
3ef2ca
--- 123,136 ----
3ef2ca
  file for a moment and come back to the same file and be in diff mode again.
3ef2ca
  
3ef2ca
  							*:diffo* *:diffoff*
3ef2ca
! :diffo[ff]	Switch off diff mode for the current window.  Resets related
3ef2ca
! 		options also when 'diff' was not set.
3ef2ca
  
3ef2ca
  :diffo[ff]!	Switch off diff mode for the current window and in all windows
3ef2ca
! 		in the current tab page where 'diff' is set.  Resetting
3ef2ca
! 		related options only happens in a window that has 'diff' set,
3ef2ca
! 		if the current window does not have 'diff' set then no options
3ef2ca
! 		in it are changed.
3ef2ca
  
3ef2ca
  The ":diffoff" command resets the relevant options to the values they had when
3ef2ca
  using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode.
3ef2ca
***************
3ef2ca
*** 262,274 ****
3ef2ca
  		See below for [range].
3ef2ca
  
3ef2ca
  							*do*
3ef2ca
! do		Same as ":diffget" without argument or range.  The "o" stands
3ef2ca
! 		for "obtain" ("dg" can't be used, it could be the start of
3ef2ca
! 		"dgg"!). Note: this doesn't work in Visual mode.
3ef2ca
  
3ef2ca
  							*dp*
3ef2ca
! dp		Same as ":diffput" without argument or range.
3ef2ca
! 		Note: this doesn't work in Visual mode.
3ef2ca
  
3ef2ca
  
3ef2ca
  When no [range] is given, the diff at the cursor position or just above it is
3ef2ca
--- 266,282 ----
3ef2ca
  		See below for [range].
3ef2ca
  
3ef2ca
  							*do*
3ef2ca
! [count]do	Same as ":diffget" without range.  The "o" stands for "obtain"
3ef2ca
! 		("dg" can't be used, it could be the start of "dgg"!). Note:
3ef2ca
! 		this doesn't work in Visual mode.
3ef2ca
! 		If you give a [count], it is used as the [bufspec] argument
3ef2ca
! 		for ":diffget".
3ef2ca
  
3ef2ca
  							*dp*
3ef2ca
! [count]dp	Same as ":diffput" without range.  Note: this doesn't work in
3ef2ca
! 		Visual mode.
3ef2ca
! 		If you give a [count], it is used as the [bufspec] argument
3ef2ca
! 		for ":diffput".
3ef2ca
  
3ef2ca
  
3ef2ca
  When no [range] is given, the diff at the cursor position or just above it is
3ef2ca
*** ../vim-7.4.489/src/diff.c	2014-10-15 12:56:44.006015955 +0200
3ef2ca
--- src/diff.c	2014-10-31 13:44:20.739228953 +0100
3ef2ca
***************
3ef2ca
*** 2107,2118 ****
3ef2ca
   * "dp" and "do" commands.
3ef2ca
   */
3ef2ca
      void
3ef2ca
! nv_diffgetput(put)
3ef2ca
      int		put;
3ef2ca
  {
3ef2ca
      exarg_T	ea;
3ef2ca
  
3ef2ca
!     ea.arg = (char_u *)"";
3ef2ca
      if (put)
3ef2ca
  	ea.cmdidx = CMD_diffput;
3ef2ca
      else
3ef2ca
--- 2107,2126 ----
3ef2ca
   * "dp" and "do" commands.
3ef2ca
   */
3ef2ca
      void
3ef2ca
! nv_diffgetput(put, count)
3ef2ca
      int		put;
3ef2ca
+     long	count;
3ef2ca
  {
3ef2ca
      exarg_T	ea;
3ef2ca
+     char_u	buf[30];
3ef2ca
  
3ef2ca
!     if (count == 0)
3ef2ca
! 	ea.arg = (char_u *)"";
3ef2ca
!     else
3ef2ca
!     {
3ef2ca
! 	vim_snprintf((char *)buf, 30, "%ld", count);
3ef2ca
! 	ea.arg = buf;
3ef2ca
!     }
3ef2ca
      if (put)
3ef2ca
  	ea.cmdidx = CMD_diffput;
3ef2ca
      else
3ef2ca
*** ../vim-7.4.489/src/normal.c	2014-10-09 14:48:26.284898230 +0200
3ef2ca
--- src/normal.c	2014-10-31 13:36:32.671240232 +0100
3ef2ca
***************
3ef2ca
*** 9284,9290 ****
3ef2ca
  	if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p')
3ef2ca
  	{
3ef2ca
  	    clearop(cap->oap);
3ef2ca
! 	    nv_diffgetput(TRUE);
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  #endif
3ef2ca
--- 9284,9290 ----
3ef2ca
  	if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p')
3ef2ca
  	{
3ef2ca
  	    clearop(cap->oap);
3ef2ca
! 	    nv_diffgetput(TRUE, cap->opcount);
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  #endif
3ef2ca
***************
3ef2ca
*** 9407,9413 ****
3ef2ca
      if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o')
3ef2ca
      {
3ef2ca
  	clearop(cap->oap);
3ef2ca
! 	nv_diffgetput(FALSE);
3ef2ca
      }
3ef2ca
      else
3ef2ca
  #endif
3ef2ca
--- 9407,9413 ----
3ef2ca
      if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o')
3ef2ca
      {
3ef2ca
  	clearop(cap->oap);
3ef2ca
! 	nv_diffgetput(FALSE, cap->opcount);
3ef2ca
      }
3ef2ca
      else
3ef2ca
  #endif
3ef2ca
*** ../vim-7.4.489/src/proto/diff.pro	2013-08-10 13:37:07.000000000 +0200
3ef2ca
--- src/proto/diff.pro	2014-10-31 13:36:32.671240232 +0100
3ef2ca
***************
3ef2ca
*** 18,24 ****
3ef2ca
  int diffopt_horizontal __ARGS((void));
3ef2ca
  int diff_find_change __ARGS((win_T *wp, linenr_T lnum, int *startp, int *endp));
3ef2ca
  int diff_infold __ARGS((win_T *wp, linenr_T lnum));
3ef2ca
! void nv_diffgetput __ARGS((int put));
3ef2ca
  void ex_diffgetput __ARGS((exarg_T *eap));
3ef2ca
  int diff_mode_buf __ARGS((buf_T *buf));
3ef2ca
  int diff_move_to __ARGS((int dir, long count));
3ef2ca
--- 18,24 ----
3ef2ca
  int diffopt_horizontal __ARGS((void));
3ef2ca
  int diff_find_change __ARGS((win_T *wp, linenr_T lnum, int *startp, int *endp));
3ef2ca
  int diff_infold __ARGS((win_T *wp, linenr_T lnum));
3ef2ca
! void nv_diffgetput __ARGS((int put, long count));
3ef2ca
  void ex_diffgetput __ARGS((exarg_T *eap));
3ef2ca
  int diff_mode_buf __ARGS((buf_T *buf));
3ef2ca
  int diff_move_to __ARGS((int dir, long count));
3ef2ca
*** ../vim-7.4.489/src/version.c	2014-10-31 12:41:57.427319153 +0100
3ef2ca
--- src/version.c	2014-10-31 13:37:54.511238260 +0100
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     490,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
GUARD #2:  It could be carried by an African swallow!
3ef2ca
GUARD #1:  Oh, yeah, an African swallow maybe, but not a European swallow,
3ef2ca
           that's my point.
3ef2ca
GUARD #2:  Oh, yeah, I agree with that...
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    ///