Patch 8.2.0018
Problem:    :join does not add white space where it should. (Zdenek Dohnal)
Solution:   Handle joining multiple lines propely.
Files:      src/ops.c, src/testdir/test_join.vim


*** ../vim-8.2.0017/src/ops.c   2019-12-13 19:29:22.376873472 +0100
--- src/ops.c   2019-12-17 22:08:23.956928903 +0100
***************
*** 2001,2007 ****
        {
            curr = skipwhite(curr);
            if (*curr != NUL && *curr != ')'
!                   && currsize != 0 && endcurr1 != TAB
                    && (!has_format_option(FO_MBYTE_JOIN)
                        || (mb_ptr2char(curr) < 0x100 && endcurr1 < 0x100))
                    && (!has_format_option(FO_MBYTE_JOIN2)
--- 2001,2007 ----
        {
            curr = skipwhite(curr);
            if (*curr != NUL && *curr != ')'
!                   && sumsize != 0 && endcurr1 != TAB
                    && (!has_format_option(FO_MBYTE_JOIN)
                        || (mb_ptr2char(curr) < 0x100 && endcurr1 < 0x100))
                    && (!has_format_option(FO_MBYTE_JOIN2)
*** ../vim-8.2.0017/src/testdir/test_join.vim   2019-11-12 20:26:21.000000000 
+0100
--- src/testdir/test_join.vim   2019-12-17 22:10:23.044487429 +0100
***************
*** 427,429 ****
--- 427,440 ----
    call assert_equal(expected, getline(1, '$'))
    close!
  endfunc
+ 
+ func Test_join_lines()
+   new
+   call setline(1, ['a', 'b', '', 'c', 'd'])
+   %join
+   call assert_equal('a b c d', getline(1))
+   call setline(1, ['a', 'b', '', 'c', 'd'])
+   normal 5J
+   call assert_equal('a b c d', getline(1))
+   bwipe!
+ endfunc
*** ../vim-8.2.0017/src/version.c       2019-12-17 21:27:14.690319902 +0100
--- src/version.c       2019-12-17 22:10:40.236423761 +0100
***************
*** 744,745 ****
--- 744,747 ----
  {   /* Add new patch number below this line */
+ /**/
+     18,
  /**/

-- 
ZOOT:  I'm afraid our life must seem very dull and quiet compared to yours.
       We are but eightscore young blondes, all between sixteen and
       nineteen-and-a-half, cut off in this castle, with no one to protect us.
       Oooh.  It is a lonely life ... bathing ...  dressing ... undressing ...
       making exciting underwear....
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201912172111.xBHLBO4Q012789%40masaka.moolenaar.net.

Raspunde prin e-mail lui