mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Merge pull request #187 from macvim-dev/fix/emoji_range
Fix Emoji range #184
This commit is contained in:
+92
-11
@@ -1244,16 +1244,8 @@ utf_char2cells(c)
|
||||
static struct interval doublewidth[] =
|
||||
{
|
||||
{0x1100, 0x115f},
|
||||
{0x2300, 0x23ff},
|
||||
{0x2700, 0x2757},
|
||||
{0x275d, 0x2767},
|
||||
{0x2776, 0x27bf},
|
||||
{0x2b00, 0x2b1c},
|
||||
{0x2b1f, 0x2b29},
|
||||
{0x2b2c, 0x2b2d},
|
||||
{0x2b30, 0x2b55},
|
||||
{0x2b90, 0x2b91},
|
||||
{0x2e00, 0x2e99},
|
||||
{0x2329, 0x232a},
|
||||
{0x2e80, 0x2e99},
|
||||
{0x2e9b, 0x2ef3},
|
||||
{0x2f00, 0x2fd5},
|
||||
{0x2ff0, 0x2ffb},
|
||||
@@ -1279,11 +1271,98 @@ utf_char2cells(c)
|
||||
{0xfe68, 0xfe6b},
|
||||
{0xff01, 0xff60},
|
||||
{0xffe0, 0xffe6},
|
||||
{0x10000, 0x1fffd},
|
||||
{0x1b000, 0x1b001},
|
||||
{0x1f200, 0x1f202},
|
||||
{0x1f210, 0x1f23a},
|
||||
{0x1f240, 0x1f248},
|
||||
{0x1f250, 0x1f251},
|
||||
{0x20000, 0x2fffd},
|
||||
{0x30000, 0x3fffd}
|
||||
};
|
||||
|
||||
/* Sorted list of non-overlapping intervals of Emoji characters,
|
||||
* based on http://unicode.org/emoji/charts/emoji-list.html */
|
||||
static struct interval emoji[] =
|
||||
{
|
||||
{0x2196, 0x2199},
|
||||
{0x21a9, 0x21aa},
|
||||
{0x231a, 0x231b},
|
||||
{0x2328, 0x2328},
|
||||
{0x23cf, 0x23cf},
|
||||
{0x23e9, 0x23f3},
|
||||
{0x23f8, 0x23fa},
|
||||
{0x24c2, 0x24c2},
|
||||
{0x25b6, 0x25b6},
|
||||
{0x25c0, 0x25c0},
|
||||
{0x25fb, 0x25fe},
|
||||
{0x2600, 0x2604},
|
||||
{0x260e, 0x260e},
|
||||
{0x2611, 0x2611},
|
||||
{0x2614, 0x2615},
|
||||
{0x2618, 0x2618},
|
||||
{0x261d, 0x261d},
|
||||
{0x2620, 0x2620},
|
||||
{0x2622, 0x2623},
|
||||
{0x2626, 0x2626},
|
||||
{0x262a, 0x262a},
|
||||
{0x262e, 0x262f},
|
||||
{0x2638, 0x2639},
|
||||
{0x2648, 0x2653},
|
||||
{0x2668, 0x2668},
|
||||
{0x267b, 0x267b},
|
||||
{0x267f, 0x267f},
|
||||
{0x2692, 0x2694},
|
||||
{0x2696, 0x2697},
|
||||
{0x2699, 0x2699},
|
||||
{0x269b, 0x269c},
|
||||
{0x26a0, 0x26a1},
|
||||
{0x26aa, 0x26ab},
|
||||
{0x26b0, 0x26b1},
|
||||
{0x26bd, 0x26be},
|
||||
{0x26c4, 0x26c5},
|
||||
{0x26c8, 0x26c8},
|
||||
{0x26ce, 0x26cf},
|
||||
{0x26d1, 0x26d1},
|
||||
{0x26d3, 0x26d4},
|
||||
{0x26e9, 0x26ea},
|
||||
{0x26f0, 0x26f5},
|
||||
{0x26f7, 0x26fa},
|
||||
{0x26fd, 0x26fd},
|
||||
{0x2702, 0x2702},
|
||||
{0x2705, 0x2705},
|
||||
{0x2708, 0x270b},
|
||||
{0x270d, 0x270d},
|
||||
{0x270f, 0x270f},
|
||||
{0x2712, 0x2712},
|
||||
{0x2714, 0x2714},
|
||||
{0x2716, 0x2716},
|
||||
{0x271d, 0x271d},
|
||||
{0x2721, 0x2721},
|
||||
{0x2728, 0x2728},
|
||||
{0x2733, 0x2734},
|
||||
{0x2744, 0x2744},
|
||||
{0x2747, 0x2747},
|
||||
{0x274c, 0x274c},
|
||||
{0x274e, 0x274e},
|
||||
{0x2753, 0x2755},
|
||||
{0x2757, 0x2757},
|
||||
{0x2764, 0x2764},
|
||||
{0x2795, 0x2797},
|
||||
{0x27a1, 0x27a1},
|
||||
{0x27b0, 0x27b0},
|
||||
{0x27bf, 0x27bf},
|
||||
{0x2934, 0x2935},
|
||||
{0x2b05, 0x2b07},
|
||||
{0x2b1b, 0x2b1c},
|
||||
{0x2b50, 0x2b50},
|
||||
{0x2b55, 0x2b55},
|
||||
{0x3030, 0x3030},
|
||||
{0x303d, 0x303d},
|
||||
{0x3297, 0x3297},
|
||||
{0x3299, 0x3299},
|
||||
{0x1f000, 0x1fffd}
|
||||
};
|
||||
|
||||
/* Sorted list of non-overlapping intervals of East Asian Ambiguous
|
||||
* characters, generated with ../runtime/tools/unicode.vim. */
|
||||
static struct interval ambiguous[] =
|
||||
@@ -1482,6 +1561,8 @@ utf_char2cells(c)
|
||||
if (intable(doublewidth, sizeof(doublewidth), c))
|
||||
return 2;
|
||||
#endif
|
||||
if (intable(emoji, sizeof(emoji), c))
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Characters below 0x100 are influenced by 'isprint' option */
|
||||
|
||||
Reference in New Issue
Block a user