aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Walch <florian@fwalch.com>2014-12-23 13:06:39 +0100
committerFlorian Walch <florian@fwalch.com>2015-01-04 11:55:38 +0100
commit1cf933e7befffb4077ef14f2f87a9ed9eecdd625 (patch)
tree6448eab136ea8cdcdb7816d1c1dd819f8b96b4c0
parent10ff6ee0d7efedc4e3812b39dc8327b8aeef57a7 (diff)
downloadrneovim-1cf933e7befffb4077ef14f2f87a9ed9eecdd625.tar.gz
rneovim-1cf933e7befffb4077ef14f2f87a9ed9eecdd625.tar.bz2
rneovim-1cf933e7befffb4077ef14f2f87a9ed9eecdd625.zip
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
-rw-r--r--src/nvim/diff.c15
-rw-r--r--src/nvim/normal.c7
-rw-r--r--src/nvim/version.c2
3 files changed, 17 insertions, 7 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 7e31c3f216..ccff4520dc 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -2017,17 +2017,24 @@ int diff_infold(win_T *wp, linenr_T lnum)
}
/// "dp" and "do" commands.
-///
-/// @param put
-void nv_diffgetput(int put)
+void nv_diffgetput(bool put, size_t count)
{
exarg_T ea;
- ea.arg = (char_u *)"";
+ char buf[30];
+
+ if (count == 0) {
+ ea.arg = (char_u *)"";
+ } else {
+ vim_snprintf(buf, 30, "%zu", count);
+ ea.arg = (char_u *)buf;
+ }
+
if (put) {
ea.cmdidx = CMD_diffput;
} else {
ea.cmdidx = CMD_diffget;
}
+
ea.addr_count = 0;
ea.line1 = curwin->w_cursor.lnum;
ea.line2 = curwin->w_cursor.lnum;
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index e1dc2b93d9..5a6cc92a33 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -11,6 +11,7 @@
* the operators.
*/
+#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h>
@@ -7246,7 +7247,8 @@ static void nv_put(cmdarg_T *cap)
/* "dp" is ":diffput" */
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p') {
clearop(cap->oap);
- nv_diffgetput(true);
+ assert(cap->opcount >= 0);
+ nv_diffgetput(true, (size_t)cap->opcount);
} else
clearopbeep(cap->oap);
} else {
@@ -7348,7 +7350,8 @@ static void nv_open(cmdarg_T *cap)
/* "do" is ":diffget" */
if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o') {
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 */
v_swap_corners(cap->cmdchar);
else
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 561ba008e1..c41610fd0f 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -248,7 +248,7 @@ static int included_patches[] = {
493,
//492,
491,
- //490,
+ 490,
489,
488,
487,