diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-07-01 15:29:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-01 15:29:20 +0200 |
commit | ef9ef75a7b1e29002745d596e31a1d5ecff1be89 (patch) | |
tree | 11026785224fb64c4a524f87d66a1ef71ec30db7 /src/nvim/mbyte.c | |
parent | 22d95e462ec32e1b6c28b310e80c9c001edc0fe1 (diff) | |
parent | 3e4a058b01db779e087eaf97826cee545de2a923 (diff) | |
download | rneovim-ef9ef75a7b1e29002745d596e31a1d5ecff1be89.tar.gz rneovim-ef9ef75a7b1e29002745d596e31a1d5ecff1be89.tar.bz2 rneovim-ef9ef75a7b1e29002745d596e31a1d5ecff1be89.zip |
Merge #8635 from janlazo/vim-8.0.0252
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r-- | src/nvim/mbyte.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index ea538fb4fc..65a1a8246c 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -428,7 +428,7 @@ int mb_get_class_tab(const char_u *p, const uint64_t *const chartab) } return 1; } - return utf_class(utf_ptr2char(p)); + return utf_class_tab(utf_ptr2char(p), chartab); } /* @@ -1039,7 +1039,12 @@ bool utf_printable(int c) * 1: punctuation * 2 or bigger: some class of word character. */ -int utf_class(int c) +int utf_class(const int c) +{ + return utf_class_tab(c, curbuf->b_chartab); +} + +int utf_class_tab(const int c, const uint64_t *const chartab) { /* sorted list of non-overlapping intervals */ static struct clinterval { @@ -1122,11 +1127,13 @@ int utf_class(int c) /* First quick check for Latin1 characters, use 'iskeyword'. */ if (c < 0x100) { - if (c == ' ' || c == '\t' || c == NUL || c == 0xa0) - return 0; /* blank */ - if (vim_iswordc(c)) - return 2; /* word character */ - return 1; /* punctuation */ + if (c == ' ' || c == '\t' || c == NUL || c == 0xa0) { + return 0; // blank + } + if (vim_iswordc_tab(c, chartab)) { + return 2; // word character + } + return 1; // punctuation } /* binary search in table */ |