diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-22 17:59:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-22 17:59:35 +0100 |
commit | 032a2d050b82b146d70d6ff714838ee62c07d8ad (patch) | |
tree | 03f817b100395145e6ee45df16fd541ede28945d | |
parent | cd45ed03bfdd7fac53d562ad402df74bd26e7754 (diff) | |
download | vim-git-032a2d050b82b146d70d6ff714838ee62c07d8ad.tar.gz |
patch 8.2.2189: cannot repeat a command that uses the small delete registerv8.2.2189
Problem: Cannot repeat a command that uses the small delete register.
Solution: Store the register name instead of the contents. (Christian
Brabandt, closes #7527)
-rw-r--r-- | src/ops.c | 2 | ||||
-rw-r--r-- | src/register.c | 9 | ||||
-rw-r--r-- | src/testdir/test_registers.vim | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 22 insertions, 2 deletions
@@ -9,7 +9,7 @@ /* * ops.c: implementation of various operators: op_shift, op_delete, op_tilde, - * op_change, op_yank, do_put, do_join + * op_change, op_yank, do_join */ #include "vim.h" diff --git a/src/register.c b/src/register.c index 6574432bd..56b6cadec 100644 --- a/src/register.c +++ b/src/register.c @@ -809,7 +809,14 @@ insert_reg( { for (i = 0; i < y_current->y_size; ++i) { - stuffescaped(y_current->y_array[i], literally); + if (regname == '-') + { + AppendCharToRedobuff(Ctrl_R); + AppendCharToRedobuff(regname); + do_put(regname, NULL, BACKWARD, 1L, PUT_CURSEND); + } + else + stuffescaped(y_current->y_array[i], literally); // Insert a newline between lines and after last line if // y_type is MLINE. if (y_current->y_type == MLINE || i < y_current->y_size - 1) diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim index 521f8ad35..14febad70 100644 --- a/src/testdir/test_registers.vim +++ b/src/testdir/test_registers.vim @@ -698,4 +698,15 @@ func Test_ve_blockpaste() bwipe! endfunc +func Test_insert_small_delete() + new + call setline(1, ['foo foobar bar']) + call cursor(1,1) + exe ":norm! ciw'\<C-R>-'" + call assert_equal(getline(1), "'foo' foobar bar") + exe ":norm! w.w." + call assert_equal(getline(1), "'foo' 'foobar' 'bar'") + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index d6eaf8d7e..65dfcdfae 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2189, +/**/ 2188, /**/ 2187, |