summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ops.c3
-rw-r--r--src/testdir/test_join.vim21
-rw-r--r--src/version.c2
3 files changed, 25 insertions, 1 deletions
diff --git a/src/ops.c b/src/ops.c
index 85e99f7ea..258b27173 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1999,7 +1999,8 @@ do_join(
if (insert_space && t > 0)
{
curr = skipwhite(curr);
- if (*curr != ')' && currsize != 0 && endcurr1 != TAB
+ 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)
diff --git a/src/testdir/test_join.vim b/src/testdir/test_join.vim
index 78835b2cc..5801c2f12 100644
--- a/src/testdir/test_join.vim
+++ b/src/testdir/test_join.vim
@@ -9,6 +9,27 @@ func Test_join_with_count()
call setline(1, ['one', 'two', 'three', 'four'])
normal 10J
call assert_equal('one two three four', getline(1))
+
+ call setline(1, ['one', '', 'two'])
+ normal J
+ call assert_equal('one', getline(1))
+
+ call setline(1, ['one', ' ', 'two'])
+ normal J
+ call assert_equal('one', getline(1))
+
+ call setline(1, ['one', '', '', 'two'])
+ normal JJ
+ call assert_equal('one', getline(1))
+
+ call setline(1, ['one', ' ', ' ', 'two'])
+ normal JJ
+ call assert_equal('one', getline(1))
+
+ call setline(1, ['one', '', '', 'two'])
+ normal 2J
+ call assert_equal('one', getline(1))
+
quit!
endfunc
diff --git a/src/version.c b/src/version.c
index 0e9b27be5..31133c53e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2293,
+/**/
2292,
/**/
2291,