aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-09-22 00:58:46 -0400
committerJames McCoy <jamessan@jamessan.com>2016-09-24 15:02:51 -0400
commit9e1c659666b5909b0ebb77406db42bc6892659d6 (patch)
tree8f1e78b892b0ca8e799879e597ecf4e377150e59 /src/nvim/mbyte.c
parent9419a4c86c9bbcd40f2146a97ad7ceac8ec8b847 (diff)
downloadrneovim-9e1c659666b5909b0ebb77406db42bc6892659d6.tar.gz
rneovim-9e1c659666b5909b0ebb77406db42bc6892659d6.tar.bz2
rneovim-9e1c659666b5909b0ebb77406db42bc6892659d6.zip
vim-patch:7.4.1697
Problem: Display problems when the 'ambiwidth' and 'emoji' options are not set properly or the terminal doesn't behave as expected. Solution: After drawing an ambiguous width character always position the cursor. https://github.com/vim/vim/commit/cb0700844c1274fe8bc0ceaffaee0ad21c406f30
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 2978171051..c08b9e8fcf 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -1724,12 +1724,11 @@ int utf_class(int c)
return 2;
}
-/*
- * Code for Unicode case-dependent operations. Based on notes in
- * http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
- * This code uses simple case folding, not full case folding.
- * Last updated for Unicode 5.2.
- */
+int utf_ambiguous_width(int c)
+{
+ return c >= 0x80 && (intable(ambiguous, ARRAY_SIZE(ambiguous), c)
+ || intable(emoji_all, ARRAY_SIZE(emoji_all), c));
+}
/*
* Generic conversion function for case operations.