vim-patch:7.4.490

Problem:    Cannot specify the buffer to use for "do" and "dp", making them
	    useless for three-way diff.
Solution:   Use the count as the buffer number. (James McCoy)

https://code.google.com/p/vim/source/detail?r=v7-4-490
This commit is contained in:
Florian Walch
2014-12-23 13:06:39 +01:00
parent 10ff6ee0d7
commit 1cf933e7be
3 changed files with 17 additions and 7 deletions

View File

@@ -2017,17 +2017,24 @@ int diff_infold(win_T *wp, linenr_T lnum)
} }
/// "dp" and "do" commands. /// "dp" and "do" commands.
/// void nv_diffgetput(bool put, size_t count)
/// @param put
void nv_diffgetput(int put)
{ {
exarg_T ea; exarg_T ea;
char buf[30];
if (count == 0) {
ea.arg = (char_u *)""; ea.arg = (char_u *)"";
} else {
vim_snprintf(buf, 30, "%zu", count);
ea.arg = (char_u *)buf;
}
if (put) { if (put) {
ea.cmdidx = CMD_diffput; ea.cmdidx = CMD_diffput;
} else { } else {
ea.cmdidx = CMD_diffget; ea.cmdidx = CMD_diffget;
} }
ea.addr_count = 0; ea.addr_count = 0;
ea.line1 = curwin->w_cursor.lnum; ea.line1 = curwin->w_cursor.lnum;
ea.line2 = curwin->w_cursor.lnum; ea.line2 = curwin->w_cursor.lnum;

View File

@@ -11,6 +11,7 @@
* the operators. * the operators.
*/ */
#include <assert.h>
#include <errno.h> #include <errno.h>
#include <inttypes.h> #include <inttypes.h>
#include <string.h> #include <string.h>
@@ -7246,7 +7247,8 @@ static void nv_put(cmdarg_T *cap)
/* "dp" is ":diffput" */ /* "dp" is ":diffput" */
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p') { if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p') {
clearop(cap->oap); clearop(cap->oap);
nv_diffgetput(true); assert(cap->opcount >= 0);
nv_diffgetput(true, (size_t)cap->opcount);
} else } else
clearopbeep(cap->oap); clearopbeep(cap->oap);
} else { } else {
@@ -7348,7 +7350,8 @@ static void nv_open(cmdarg_T *cap)
/* "do" is ":diffget" */ /* "do" is ":diffget" */
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o') { if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o') {
clearop(cap->oap); clearop(cap->oap);
nv_diffgetput(false); assert(cap->opcount >= 0);
nv_diffgetput(false, (size_t)cap->opcount);
} else if (VIsual_active) /* switch start and end of visual */ } else if (VIsual_active) /* switch start and end of visual */
v_swap_corners(cap->cmdchar); v_swap_corners(cap->cmdchar);
else else

View File

@@ -248,7 +248,7 @@ static int included_patches[] = {
493, 493,
//492, //492,
491, 491,
//490, 490,
489, 489,
488, 488,
487, 487,