aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-09-22 00:40:45 -0400
committerJames McCoy <jamessan@jamessan.com>2016-09-24 14:03:22 -0400
commit45598d2e5e2b56e24e4d5abe4f28f259e3def572 (patch)
tree809db52bae466f1e283f8a8c8a6024596c5ea67b /src/nvim/mbyte.c
parent49735d6fae3d99a05ff63625bb0baf10deae9c71 (diff)
downloadrneovim-45598d2e5e2b56e24e4d5abe4f28f259e3def572.tar.gz
rneovim-45598d2e5e2b56e24e4d5abe4f28f259e3def572.tar.bz2
rneovim-45598d2e5e2b56e24e4d5abe4f28f259e3def572.zip
vim-patch:7.4.1620
Problem: Emoji characters are not considered as a kind of word character. Solution: Give emoji characters a word class number. (Yashuhiro Matsumoto) https://github.com/vim/vim/commit/4077b33a8370afb3d5ae74e556a0119cf51fe294
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c7
1 files changed, 6 insertions, 1 deletions
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;
}