Mercurial > vim
diff src/mbyte.c @ 10724:ae1c6bf22e5f v8.0.0252
patch 8.0.0252: not properly recognizing word characters between 128 and 255
commit https://github.com/vim/vim/commit/4019cf90b8657d4ab1c39744db63550f44f405a2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 28 16:39:34 2017 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 28 Jan 2017 16:45:04 +0100 |
parents | b726d3ea70bc |
children | 506f5d8b7d8b |
line wrap: on
line diff
--- 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 */ }