neovim/neovim — pull request #1729 by fwalch (2014-12-23 15:28:42+00:00)
Title: [RFC] 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
```

Original patch (proto, version.c changes removed for brevity):

```diff
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -2107,12 +2107,20 @@ diff_infold(wp, lnum)
* "dp" and "do" commands.
*/
void
-nv_diffgetput(put)
+nv_diffgetput(put, count)
int	put;
+ long	count;
{
exarg_T	ea;
+ char_u	buf[30];

- ea.arg = (char_u *)"";
+ if (count == 0)
+	ea.arg = (char_u *)"";
+ else
+ {
+	vim_snprintf((char *)buf, 30, "%ld", count);
+	ea.arg = buf;
+ }
if (put)
ea.cmdidx = CMD_diffput;
else
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -9284,7 +9284,7 @@ nv_put(cap)
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p')
{
clearop(cap->oap);
-	nv_diffgetput(TRUE);
+	nv_diffgetput(TRUE, cap->opcount);
}
else
#endif
@@ -9407,7 +9407,7 @@ nv_open(cap)
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o')
{
clearop(cap->oap);
-	nv_diffgetput(FALSE);
+	nv_diffgetput(FALSE, cap->opcount);
}
else
#endif
```