mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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)
This commit is contained in:
10
src/mbyte.c
10
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 */
|
||||
}
|
||||
|
Reference in New Issue
Block a user