To: vim_dev@googlegroups.com Subject: Patch 8.2.2189 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: src/ops.c, src/register.c, src/testdir/test_registers.vim *** ../vim-8.2.2188/src/ops.c 2020-12-22 12:20:04.541293877 +0100 --- src/ops.c 2020-12-22 17:58:50.975227356 +0100 *************** *** 9,15 **** /* * ops.c: implementation of various operators: op_shift, op_delete, op_tilde, ! * op_change, op_yank, do_put, do_join */ #include "vim.h" --- 9,15 ---- /* * ops.c: implementation of various operators: op_shift, op_delete, op_tilde, ! * op_change, op_yank, do_join */ #include "vim.h" *** ../vim-8.2.2188/src/register.c 2020-11-26 20:33:56.856583887 +0100 --- src/register.c 2020-12-22 17:58:50.975227356 +0100 *************** *** 809,815 **** { for (i = 0; i < y_current->y_size; ++i) { ! 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) --- 809,822 ---- { for (i = 0; i < y_current->y_size; ++i) { ! 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) *** ../vim-8.2.2188/src/testdir/test_registers.vim 2020-10-04 16:16:50.919838655 +0200 --- src/testdir/test_registers.vim 2020-12-22 17:58:50.975227356 +0100 *************** *** 698,701 **** --- 698,712 ---- bwipe! endfunc + func Test_insert_small_delete() + new + call setline(1, ['foo foobar bar']) + call cursor(1,1) + exe ":norm! ciw'\-'" + 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 *** ../vim-8.2.2188/src/version.c 2020-12-22 17:35:50.043978116 +0100 --- src/version.c 2020-12-22 17:57:21.999626326 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2189, /**/ -- Often you're less important than your furniture. If you think about it, you can get fired but your furniture stays behind, gainfully employed at the company that didn't need _you_ anymore. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///