summaryrefslogtreecommitdiff
path: root/src/mbyte.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-28 16:39:34 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-28 16:39:34 +0100
commit4019cf90b8657d4ab1c39744db63550f44f405a2 (patch)
treedd19804e007e7748d0d2ca5a0e4aaa5dd0a19217 /src/mbyte.c
parentf42dd3c3901ea0ba38e67a616aea9953cae81b8d (diff)
downloadvim-git-4019cf90b8657d4ab1c39744db63550f44f405a2.tar.gz
patch 8.0.0252: not properly recognizing word characters between 128 and 255v8.0.0252
Problem: Characters below 256 that are not one byte are not always recognized as word characters. Solution: Make vim_iswordc() and vim_iswordp() work the same way. Add a test for this. (Ozaki Kiichi)
Diffstat (limited to 'src/mbyte.c')
-rw-r--r--src/mbyte.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mbyte.c b/src/mbyte.c
index 321bff58d..11dc0fb35 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -895,7 +895,7 @@ mb_get_class_buf(char_u *p, buf_T *buf)
if (enc_dbcs != 0 && p[0] != NUL && p[1] != NUL)
return dbcs_class(p[0], p[1]);
if (enc_utf8)
- return utf_class(utf_ptr2char(p));
+ return utf_class_buf(utf_ptr2char(p), buf);
return 0;
}
@@ -2694,6 +2694,12 @@ static struct interval emoji_all[] =
int
utf_class(int c)
{
+ return utf_class_buf(c, curbuf);
+}
+
+ int
+utf_class_buf(int c, buf_T *buf)
+{
/* sorted list of non-overlapping intervals */
static struct clinterval
{
@@ -2780,7 +2786,7 @@ utf_class(int c)
{
if (c == ' ' || c == '\t' || c == NUL || c == 0xa0)
return 0; /* blank */
- if (vim_iswordc(c))
+ if (vim_iswordc_buf(c, buf))
return 2; /* word character */
return 1; /* punctuation */
}