patch 8.2.0018: :join does not add white space where it should
Problem: :join does not add white space where it should. (Zdenek Dohnal)
Solution: Handle joining multiple lines propely.
diff --git a/src/testdir/test_join.vim b/src/testdir/test_join.vim
index 5801c2f..377edab 100644
--- a/src/testdir/test_join.vim
+++ b/src/testdir/test_join.vim
@@ -427,3 +427,14 @@
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