summaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-12 20:31:20 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-12 20:31:20 +0100
commitcc184cfb09161b3bbc7d5d8859a18e812367d19c (patch)
treef4c2c860ec034a3466ca89968bd8d8f5b50d99e2 /src/ops.c
parentd002e411c60a231b7c136a84422b3d9bf7b8b4df (diff)
downloadvim-git-cc184cfb09161b3bbc7d5d8859a18e812367d19c.tar.gz
patch 8.1.2293: join adds trailing space when second line is emptyv8.1.2293
Problem: Join adds trailing space when second line is empty. (Brennan Vincent) Solution: Do not add a trailing space.
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c3
1 files changed, 2 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)