To: vim_dev@googlegroups.com Subject: Patch 8.0.0231 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0231 Problem: There are no tests for bracketed paste mode. Solution: Add a test. Fix repeating with "normal .". Files: src/edit.c, src/testdir/test_paste.vim, src/Makefile, src/testdir/Make_all.mak *** ../vim-8.0.0230/src/edit.c 2017-01-24 17:50:48.753765383 +0100 --- src/edit.c 2017-01-24 18:51:09.797365521 +0100 *************** *** 463,469 **** else #endif { ! AppendCharToRedobuff(cmdchar); if (cmdchar == 'g') /* "gI" command */ AppendCharToRedobuff('I'); else if (cmdchar == 'r') /* "r" command */ --- 463,472 ---- else #endif { ! if (cmdchar == K_PS) ! AppendCharToRedobuff('a'); ! else ! AppendCharToRedobuff(cmdchar); if (cmdchar == 'g') /* "gI" command */ AppendCharToRedobuff('I'); else if (cmdchar == 'r') /* "r" command */ *************** *** 9502,9509 **** if (idx == 1 && (c == CAR || c == K_KENTER || c == NL)) ins_eol(c); else ins_char_bytes(buf, idx); ! AppendToRedobuffLit(buf, idx); } break; --- 9505,9514 ---- if (idx == 1 && (c == CAR || c == K_KENTER || c == NL)) ins_eol(c); else + { ins_char_bytes(buf, idx); ! AppendToRedobuffLit(buf, idx); ! } } break; *** ../vim-8.0.0230/src/testdir/test_paste.vim 2017-01-24 18:57:28.202819387 +0100 --- src/testdir/test_paste.vim 2017-01-24 18:55:26.559637737 +0100 *************** *** 0 **** --- 1,41 ---- + " Tests for bracketed paste. + + " Bracketed paste only works with "xterm". + set term=xterm + + func Test_paste_normal_mode() + new + call setline(1, ['a', 'b', 'c']) + 2 + call feedkeys("\[200~foo\bar\[201~", 'xt') + call assert_equal('bfoo', getline(2)) + call assert_equal('bar', getline(3)) + call assert_equal('c', getline(4)) + + normal . + call assert_equal('barfoo', getline(3)) + call assert_equal('bar', getline(4)) + call assert_equal('c', getline(5)) + bwipe! + endfunc + + func Test_paste_insert_mode() + new + call setline(1, ['a', 'b', 'c']) + 2 + call feedkeys("i\[200~foo\bar\[201~ done\", 'xt') + call assert_equal('foo', getline(2)) + call assert_equal('bar doneb', getline(3)) + call assert_equal('c', getline(4)) + + normal . + call assert_equal('bar donfoo', getline(3)) + call assert_equal('bar doneeb', getline(4)) + call assert_equal('c', getline(5)) + bwipe! + endfunc + + func Test_paste_cmdline() + call feedkeys(":a\[200~foo\bar\[201~b\\"\", 'xt') + call assert_equal("\"afoo\barb", getreg(':')) + endfunc *** ../vim-8.0.0230/src/Makefile 2017-01-22 20:04:36.493131648 +0100 --- src/Makefile 2017-01-24 18:06:10.631551093 +0100 *************** *** 2147,2152 **** --- 2147,2153 ---- test_options \ test_packadd \ test_partial \ + test_paste \ test_perl \ test_popup \ test_profile \ *************** *** 2161,2169 **** test_searchpos \ test_set \ test_signs \ test_sort \ test_source_utf8 \ - test_smartindent \ test_startup \ test_startup_utf8 \ test_stat \ --- 2162,2170 ---- test_searchpos \ test_set \ test_signs \ + test_smartindent \ test_sort \ test_source_utf8 \ test_startup \ test_startup_utf8 \ test_stat \ *** ../vim-8.0.0230/src/testdir/Make_all.mak 2017-01-17 22:15:42.451784910 +0100 --- src/testdir/Make_all.mak 2017-01-24 18:06:37.859367283 +0100 *************** *** 173,178 **** --- 173,179 ---- test_nested_function.res \ test_netbeans.res \ test_normal.res \ + test_paste.res \ test_packadd.res \ test_perl.res \ test_profile.res \ *** ../vim-8.0.0230/src/version.c 2017-01-24 17:50:48.757765356 +0100 --- src/version.c 2017-01-24 18:56:32.047197157 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 231, /**/ -- DEAD PERSON: I'm getting better! CUSTOMER: No, you're not -- you'll be stone dead in a moment. MORTICIAN: Oh, I can't take him like that -- it's against regulations. The Quest for the Holy Grail (Monty Python) /// 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 ///