changeset 30663:65c35212c772 v9.0.0666

patch 9.0.0666: spacing-combining characters handled as composing Commit: https://github.com/vim/vim/commit/7beaf6a720ddc7e2989c8831872bfb98ec78a65d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 5 18:03:00 2022 +0100 patch 9.0.0666: spacing-combining characters handled as composing Problem: Spacing-combining characters handled as composing, causing text to take more space than expected. Solution: Handle characters marked with "Mc" not as composing. (closes #11282
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 Oct 2022 19:15:03 +0200
parents 6dbe21e86337
children 42e4fc20b3cc
files runtime/tools/unicode.vim src/mbyte.c src/version.c
diffstat 3 files changed, 164 insertions(+), 128 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/tools/unicode.vim
+++ b/runtime/tools/unicode.vim
@@ -158,7 +158,8 @@ func! BuildCombiningTable()
   let end = -1
   let ranges = []
   for p in s:dataprops
-    if p[2] == 'Mn' || p[2] == 'Mc' || p[2] == 'Me'
+    " The 'Mc' property was removed, it does take up space.
+    if p[2] == 'Mn' || p[2] == 'Me'
       let n = ('0x' . p[0]) + 0
       if start >= 0 && end + 1 == n
         " continue with same range.
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -2338,74 +2338,67 @@ utf_iscomposing(int c)
 	{0x0859, 0x085b},
 	{0x0898, 0x089f},
 	{0x08ca, 0x08e1},
-	{0x08e3, 0x0903},
-	{0x093a, 0x093c},
-	{0x093e, 0x094f},
+	{0x08e3, 0x0902},
+	{0x093a, 0x093a},
+	{0x093c, 0x093c},
+	{0x0941, 0x0948},
+	{0x094d, 0x094d},
 	{0x0951, 0x0957},
 	{0x0962, 0x0963},
-	{0x0981, 0x0983},
+	{0x0981, 0x0981},
 	{0x09bc, 0x09bc},
-	{0x09be, 0x09c4},
-	{0x09c7, 0x09c8},
-	{0x09cb, 0x09cd},
-	{0x09d7, 0x09d7},
+	{0x09c1, 0x09c4},
+	{0x09cd, 0x09cd},
 	{0x09e2, 0x09e3},
 	{0x09fe, 0x09fe},
-	{0x0a01, 0x0a03},
+	{0x0a01, 0x0a02},
 	{0x0a3c, 0x0a3c},
-	{0x0a3e, 0x0a42},
+	{0x0a41, 0x0a42},
 	{0x0a47, 0x0a48},
 	{0x0a4b, 0x0a4d},
 	{0x0a51, 0x0a51},
 	{0x0a70, 0x0a71},
 	{0x0a75, 0x0a75},
-	{0x0a81, 0x0a83},
+	{0x0a81, 0x0a82},
 	{0x0abc, 0x0abc},
-	{0x0abe, 0x0ac5},
-	{0x0ac7, 0x0ac9},
-	{0x0acb, 0x0acd},
+	{0x0ac1, 0x0ac5},
+	{0x0ac7, 0x0ac8},
+	{0x0acd, 0x0acd},
 	{0x0ae2, 0x0ae3},
 	{0x0afa, 0x0aff},
-	{0x0b01, 0x0b03},
+	{0x0b01, 0x0b01},
 	{0x0b3c, 0x0b3c},
-	{0x0b3e, 0x0b44},
-	{0x0b47, 0x0b48},
-	{0x0b4b, 0x0b4d},
-	{0x0b55, 0x0b57},
+	{0x0b3f, 0x0b3f},
+	{0x0b41, 0x0b44},
+	{0x0b4d, 0x0b4d},
+	{0x0b55, 0x0b56},
 	{0x0b62, 0x0b63},
 	{0x0b82, 0x0b82},
-	{0x0bbe, 0x0bc2},
-	{0x0bc6, 0x0bc8},
-	{0x0bca, 0x0bcd},
-	{0x0bd7, 0x0bd7},
-	{0x0c00, 0x0c04},
+	{0x0bc0, 0x0bc0},
+	{0x0bcd, 0x0bcd},
+	{0x0c00, 0x0c00},
+	{0x0c04, 0x0c04},
 	{0x0c3c, 0x0c3c},
-	{0x0c3e, 0x0c44},
+	{0x0c3e, 0x0c40},
 	{0x0c46, 0x0c48},
 	{0x0c4a, 0x0c4d},
 	{0x0c55, 0x0c56},
 	{0x0c62, 0x0c63},
-	{0x0c81, 0x0c83},
+	{0x0c81, 0x0c81},
 	{0x0cbc, 0x0cbc},
-	{0x0cbe, 0x0cc4},
-	{0x0cc6, 0x0cc8},
-	{0x0cca, 0x0ccd},
-	{0x0cd5, 0x0cd6},
+	{0x0cbf, 0x0cbf},
+	{0x0cc6, 0x0cc6},
+	{0x0ccc, 0x0ccd},
 	{0x0ce2, 0x0ce3},
-	{0x0cf3, 0x0cf3},
-	{0x0d00, 0x0d03},
+	{0x0d00, 0x0d01},
 	{0x0d3b, 0x0d3c},
-	{0x0d3e, 0x0d44},
-	{0x0d46, 0x0d48},
-	{0x0d4a, 0x0d4d},
-	{0x0d57, 0x0d57},
+	{0x0d41, 0x0d44},
+	{0x0d4d, 0x0d4d},
 	{0x0d62, 0x0d63},
-	{0x0d81, 0x0d83},
+	{0x0d81, 0x0d81},
 	{0x0dca, 0x0dca},
-	{0x0dcf, 0x0dd4},
+	{0x0dd2, 0x0dd4},
 	{0x0dd6, 0x0dd6},
-	{0x0dd8, 0x0ddf},
-	{0x0df2, 0x0df3},
 	{0x0e31, 0x0e31},
 	{0x0e34, 0x0e3a},
 	{0x0e47, 0x0e4e},
@@ -2416,57 +2409,79 @@ utf_iscomposing(int c)
 	{0x0f35, 0x0f35},
 	{0x0f37, 0x0f37},
 	{0x0f39, 0x0f39},
-	{0x0f3e, 0x0f3f},
-	{0x0f71, 0x0f84},
+	{0x0f71, 0x0f7e},
+	{0x0f80, 0x0f84},
 	{0x0f86, 0x0f87},
 	{0x0f8d, 0x0f97},
 	{0x0f99, 0x0fbc},
 	{0x0fc6, 0x0fc6},
-	{0x102b, 0x103e},
-	{0x1056, 0x1059},
+	{0x102d, 0x1030},
+	{0x1032, 0x1037},
+	{0x1039, 0x103a},
+	{0x103d, 0x103e},
+	{0x1058, 0x1059},
 	{0x105e, 0x1060},
-	{0x1062, 0x1064},
-	{0x1067, 0x106d},
 	{0x1071, 0x1074},
-	{0x1082, 0x108d},
-	{0x108f, 0x108f},
-	{0x109a, 0x109d},
+	{0x1082, 0x1082},
+	{0x1085, 0x1086},
+	{0x108d, 0x108d},
+	{0x109d, 0x109d},
 	{0x135d, 0x135f},
-	{0x1712, 0x1715},
-	{0x1732, 0x1734},
+	{0x1712, 0x1714},
+	{0x1732, 0x1733},
 	{0x1752, 0x1753},
 	{0x1772, 0x1773},
-	{0x17b4, 0x17d3},
+	{0x17b4, 0x17b5},
+	{0x17b7, 0x17bd},
+	{0x17c6, 0x17c6},
+	{0x17c9, 0x17d3},
 	{0x17dd, 0x17dd},
 	{0x180b, 0x180d},
 	{0x180f, 0x180f},
 	{0x1885, 0x1886},
 	{0x18a9, 0x18a9},
-	{0x1920, 0x192b},
-	{0x1930, 0x193b},
-	{0x1a17, 0x1a1b},
-	{0x1a55, 0x1a5e},
-	{0x1a60, 0x1a7c},
+	{0x1920, 0x1922},
+	{0x1927, 0x1928},
+	{0x1932, 0x1932},
+	{0x1939, 0x193b},
+	{0x1a17, 0x1a18},
+	{0x1a1b, 0x1a1b},
+	{0x1a56, 0x1a56},
+	{0x1a58, 0x1a5e},
+	{0x1a60, 0x1a60},
+	{0x1a62, 0x1a62},
+	{0x1a65, 0x1a6c},
+	{0x1a73, 0x1a7c},
 	{0x1a7f, 0x1a7f},
 	{0x1ab0, 0x1ace},
-	{0x1b00, 0x1b04},
-	{0x1b34, 0x1b44},
+	{0x1b00, 0x1b03},
+	{0x1b34, 0x1b34},
+	{0x1b36, 0x1b3a},
+	{0x1b3c, 0x1b3c},
+	{0x1b42, 0x1b42},
 	{0x1b6b, 0x1b73},
-	{0x1b80, 0x1b82},
-	{0x1ba1, 0x1bad},
-	{0x1be6, 0x1bf3},
-	{0x1c24, 0x1c37},
+	{0x1b80, 0x1b81},
+	{0x1ba2, 0x1ba5},
+	{0x1ba8, 0x1ba9},
+	{0x1bab, 0x1bad},
+	{0x1be6, 0x1be6},
+	{0x1be8, 0x1be9},
+	{0x1bed, 0x1bed},
+	{0x1bef, 0x1bf1},
+	{0x1c2c, 0x1c33},
+	{0x1c36, 0x1c37},
 	{0x1cd0, 0x1cd2},
-	{0x1cd4, 0x1ce8},
+	{0x1cd4, 0x1ce0},
+	{0x1ce2, 0x1ce8},
 	{0x1ced, 0x1ced},
 	{0x1cf4, 0x1cf4},
-	{0x1cf7, 0x1cf9},
+	{0x1cf8, 0x1cf9},
 	{0x1dc0, 0x1dff},
 	{0x20d0, 0x20f0},
 	{0x2cef, 0x2cf1},
 	{0x2d7f, 0x2d7f},
 	{0x2de0, 0x2dff},
-	{0x302a, 0x302f},
+	{0x302a, 0x302d},
 	{0x3099, 0x309a},
 	{0xa66f, 0xa672},
 	{0xa674, 0xa67d},
@@ -2475,30 +2490,34 @@ utf_iscomposing(int c)
 	{0xa802, 0xa802},
 	{0xa806, 0xa806},
 	{0xa80b, 0xa80b},
-	{0xa823, 0xa827},
+	{0xa825, 0xa826},
 	{0xa82c, 0xa82c},
-	{0xa880, 0xa881},
-	{0xa8b4, 0xa8c5},
+	{0xa8c4, 0xa8c5},
 	{0xa8e0, 0xa8f1},
 	{0xa8ff, 0xa8ff},
 	{0xa926, 0xa92d},
-	{0xa947, 0xa953},
-	{0xa980, 0xa983},
-	{0xa9b3, 0xa9c0},
+	{0xa947, 0xa951},
+	{0xa980, 0xa982},
+	{0xa9b3, 0xa9b3},
+	{0xa9b6, 0xa9b9},
+	{0xa9bc, 0xa9bd},
 	{0xa9e5, 0xa9e5},
-	{0xaa29, 0xaa36},
+	{0xaa29, 0xaa2e},
+	{0xaa31, 0xaa32},
+	{0xaa35, 0xaa36},
 	{0xaa43, 0xaa43},
-	{0xaa4c, 0xaa4d},
-	{0xaa7b, 0xaa7d},
+	{0xaa4c, 0xaa4c},
+	{0xaa7c, 0xaa7c},
 	{0xaab0, 0xaab0},
 	{0xaab2, 0xaab4},
 	{0xaab7, 0xaab8},
 	{0xaabe, 0xaabf},
 	{0xaac1, 0xaac1},
-	{0xaaeb, 0xaaef},
-	{0xaaf5, 0xaaf6},
-	{0xabe3, 0xabea},
-	{0xabec, 0xabed},
+	{0xaaec, 0xaaed},
+	{0xaaf6, 0xaaf6},
+	{0xabe5, 0xabe5},
+	{0xabe8, 0xabe8},
+	{0xabed, 0xabed},
 	{0xfb1e, 0xfb1e},
 	{0xfe00, 0xfe0f},
 	{0xfe20, 0xfe2f},
@@ -2516,89 +2535,103 @@ utf_iscomposing(int c)
 	{0x10efd, 0x10eff},
 	{0x10f46, 0x10f50},
 	{0x10f82, 0x10f85},
-	{0x11000, 0x11002},
+	{0x11001, 0x11001},
 	{0x11038, 0x11046},
 	{0x11070, 0x11070},
 	{0x11073, 0x11074},
-	{0x1107f, 0x11082},
-	{0x110b0, 0x110ba},
+	{0x1107f, 0x11081},
+	{0x110b3, 0x110b6},
+	{0x110b9, 0x110ba},
 	{0x110c2, 0x110c2},
 	{0x11100, 0x11102},
-	{0x11127, 0x11134},
-	{0x11145, 0x11146},
+	{0x11127, 0x1112b},
+	{0x1112d, 0x11134},
 	{0x11173, 0x11173},
-	{0x11180, 0x11182},
-	{0x111b3, 0x111c0},
+	{0x11180, 0x11181},
+	{0x111b6, 0x111be},
 	{0x111c9, 0x111cc},
-	{0x111ce, 0x111cf},
-	{0x1122c, 0x11237},
+	{0x111cf, 0x111cf},
+	{0x1122f, 0x11231},
+	{0x11234, 0x11234},
+	{0x11236, 0x11237},
 	{0x1123e, 0x1123e},
 	{0x11241, 0x11241},
-	{0x112df, 0x112ea},
-	{0x11300, 0x11303},
+	{0x112df, 0x112df},
+	{0x112e3, 0x112ea},
+	{0x11300, 0x11301},
 	{0x1133b, 0x1133c},
-	{0x1133e, 0x11344},
-	{0x11347, 0x11348},
-	{0x1134b, 0x1134d},
-	{0x11357, 0x11357},
-	{0x11362, 0x11363},
+	{0x11340, 0x11340},
 	{0x11366, 0x1136c},
 	{0x11370, 0x11374},
-	{0x11435, 0x11446},
+	{0x11438, 0x1143f},
+	{0x11442, 0x11444},
+	{0x11446, 0x11446},
 	{0x1145e, 0x1145e},
-	{0x114b0, 0x114c3},
-	{0x115af, 0x115b5},
-	{0x115b8, 0x115c0},
+	{0x114b3, 0x114b8},
+	{0x114ba, 0x114ba},
+	{0x114bf, 0x114c0},
+	{0x114c2, 0x114c3},
+	{0x115b2, 0x115b5},
+	{0x115bc, 0x115bd},
+	{0x115bf, 0x115c0},
 	{0x115dc, 0x115dd},
-	{0x11630, 0x11640},
-	{0x116ab, 0x116b7},
-	{0x1171d, 0x1172b},
-	{0x1182c, 0x1183a},
-	{0x11930, 0x11935},
-	{0x11937, 0x11938},
-	{0x1193b, 0x1193e},
-	{0x11940, 0x11940},
-	{0x11942, 0x11943},
-	{0x119d1, 0x119d7},
-	{0x119da, 0x119e0},
-	{0x119e4, 0x119e4},
+	{0x11633, 0x1163a},
+	{0x1163d, 0x1163d},
+	{0x1163f, 0x11640},
+	{0x116ab, 0x116ab},
+	{0x116ad, 0x116ad},
+	{0x116b0, 0x116b5},
+	{0x116b7, 0x116b7},
+	{0x1171d, 0x1171f},
+	{0x11722, 0x11725},
+	{0x11727, 0x1172b},
+	{0x1182f, 0x11837},
+	{0x11839, 0x1183a},
+	{0x1193b, 0x1193c},
+	{0x1193e, 0x1193e},
+	{0x11943, 0x11943},
+	{0x119d4, 0x119d7},
+	{0x119da, 0x119db},
+	{0x119e0, 0x119e0},
 	{0x11a01, 0x11a0a},
-	{0x11a33, 0x11a39},
+	{0x11a33, 0x11a38},
 	{0x11a3b, 0x11a3e},
 	{0x11a47, 0x11a47},
-	{0x11a51, 0x11a5b},
-	{0x11a8a, 0x11a99},
-	{0x11c2f, 0x11c36},
-	{0x11c38, 0x11c3f},
+	{0x11a51, 0x11a56},
+	{0x11a59, 0x11a5b},
+	{0x11a8a, 0x11a96},
+	{0x11a98, 0x11a99},
+	{0x11c30, 0x11c36},
+	{0x11c38, 0x11c3d},
+	{0x11c3f, 0x11c3f},
 	{0x11c92, 0x11ca7},
-	{0x11ca9, 0x11cb6},
+	{0x11caa, 0x11cb0},
+	{0x11cb2, 0x11cb3},
+	{0x11cb5, 0x11cb6},
 	{0x11d31, 0x11d36},
 	{0x11d3a, 0x11d3a},
 	{0x11d3c, 0x11d3d},
 	{0x11d3f, 0x11d45},
 	{0x11d47, 0x11d47},
-	{0x11d8a, 0x11d8e},
 	{0x11d90, 0x11d91},
-	{0x11d93, 0x11d97},
-	{0x11ef3, 0x11ef6},
+	{0x11d95, 0x11d95},
+	{0x11d97, 0x11d97},
+	{0x11ef3, 0x11ef4},
 	{0x11f00, 0x11f01},
-	{0x11f03, 0x11f03},
-	{0x11f34, 0x11f3a},
-	{0x11f3e, 0x11f42},
+	{0x11f36, 0x11f3a},
+	{0x11f40, 0x11f40},
+	{0x11f42, 0x11f42},
 	{0x13440, 0x13440},
 	{0x13447, 0x13455},
 	{0x16af0, 0x16af4},
 	{0x16b30, 0x16b36},
 	{0x16f4f, 0x16f4f},
-	{0x16f51, 0x16f87},
 	{0x16f8f, 0x16f92},
 	{0x16fe4, 0x16fe4},
-	{0x16ff0, 0x16ff1},
 	{0x1bc9d, 0x1bc9e},
 	{0x1cf00, 0x1cf2d},
 	{0x1cf30, 0x1cf46},
-	{0x1d165, 0x1d169},
-	{0x1d16d, 0x1d172},
+	{0x1d167, 0x1d169},
 	{0x1d17b, 0x1d182},
 	{0x1d185, 0x1d18b},
 	{0x1d1aa, 0x1d1ad},
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    666,
+/**/
     665,
 /**/
     664,