summaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-04 18:22:13 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-04 18:22:13 +0200
commite52702f00322c8a8861efd0bd6a3775e685e5685 (patch)
treeffd498e52ee2b139f3a145147aca02afc5013d63 /src/ops.c
parent9155825b2428ef6bf654204a534b033a6879c90d (diff)
downloadvim-git-e52702f00322c8a8861efd0bd6a3775e685e5685.tar.gz
patch 8.2.0901: formatting CJK text isn't optimalv8.2.0901
Problem: Formatting CJK text isn't optimal. Solution: Properly break CJK lines. (closes #3875)
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ops.c b/src/ops.c
index ea71edbf3..ca00c252d 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1967,7 +1967,10 @@ do_join(
&& (!has_format_option(FO_MBYTE_JOIN)
|| (mb_ptr2char(curr) < 0x100 && endcurr1 < 0x100))
&& (!has_format_option(FO_MBYTE_JOIN2)
- || mb_ptr2char(curr) < 0x100 || endcurr1 < 0x100)
+ || (mb_ptr2char(curr) < 0x100
+ && !(enc_utf8 && utf_eat_space(endcurr1)))
+ || (endcurr1 < 0x100
+ && !(enc_utf8 && utf_eat_space(mb_ptr2char(curr)))))
)
{
// don't add a space if the line is ending in a space