From 4019cf90b8657d4ab1c39744db63550f44f405a2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jan 2017 16:39:34 +0100 Subject: patch 8.0.0252: not properly recognizing word characters between 128 and 255 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) --- src/mbyte.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/mbyte.c') 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; } @@ -2693,6 +2693,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 */ } -- cgit v1.2.1