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<CR>" 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<CR>" 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("\<Esc>[200~foo\<CR>bar\<Esc>[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\<Esc>[200~foo\<CR>bar\<Esc>[201~ done\<Esc>", '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\<Esc>[200~foo\<CR>bar\<Esc>[201~b\<Home>\"\<CR>", 'xt')
+   call assert_equal("\"afoo\<CR>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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui