aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/genunicodetables.lua4
-rw-r--r--src/nvim/mbyte.c7
-rw-r--r--src/nvim/version.c2
3 files changed, 9 insertions, 4 deletions
diff --git a/scripts/genunicodetables.lua b/scripts/genunicodetables.lua
index 08b8b0f90e..75adb36a8f 100644
--- a/scripts/genunicodetables.lua
+++ b/scripts/genunicodetables.lua
@@ -12,7 +12,7 @@
-- 2 then interval applies only to first, third, fifth, … character in range.
-- Fourth value is number that should be added to the codepoint to yield
-- folded/lower/upper codepoint.
--- 4. emoji table: sorted list of non-overlapping closed intervals of Emoji
+-- 4. emoji_tab table: sorted list of non-overlapping closed intervals of Emoji
-- characters
if arg[1] == '--help' then
print('Usage:')
@@ -221,7 +221,7 @@ local build_width_table = function(ut_fp, dataprops, widthprops, widths,
end
local build_emoji_table = function(ut_fp, emojiprops)
- ut_fp:write('static const struct interval emoji[] = {\n')
+ ut_fp:write('static const struct interval emoji_tab[] = {\n')
for _, p in ipairs(emojiprops) do
if p[2]:match('Emoji%s+#') then
local start, end_ = p[1]:find('%.%.')
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index e05b3f3a37..e4ed46208b 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -949,7 +949,7 @@ int utf_char2cells(int c)
if (intable(doublewidth, ARRAY_SIZE(doublewidth), c))
return 2;
#endif
- if (p_emoji && intable(emoji, ARRAY_SIZE(emoji), c)) {
+ if (p_emoji && intable(emoji_tab, ARRAY_SIZE(emoji_tab), c)) {
return 2;
}
}
@@ -1715,6 +1715,11 @@ int utf_class(int c)
return (int)classes[mid].class;
}
+ // emoji
+ if (intable(emoji_tab, ARRAY_SIZE(emoji_tab), c)) {
+ return 3;
+ }
+
/* most other characters are "word" characters */
return 2;
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 0106185d13..43aaa6b1ed 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -823,7 +823,7 @@ static int included_patches[] = {
// 1623 NA
// 1622 NA
// 1621 NA
- // 1620,
+ 1620,
// 1619,
// 1618 NA
// 1617 NA