diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-01-14 08:58:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-14 15:58:28 +0800 |
commit | e89c39d6f016a4140293755250e968e839009617 (patch) | |
tree | f5dc79208bd54132ea364511c559f83bc9cd1e95 /src/nvim/mouse.c | |
parent | 9220755302317e8030c5bbf334357c0d64df9fa4 (diff) | |
download | rneovim-e89c39d6f016a4140293755250e968e839009617.tar.gz rneovim-e89c39d6f016a4140293755250e968e839009617.tar.bz2 rneovim-e89c39d6f016a4140293755250e968e839009617.zip |
refactor: replace char_u with char 21 (#21779)
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r-- | src/nvim/mouse.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index a87143fe12..b7d15fe9af 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -58,13 +58,13 @@ static int orig_topfill = 0; /// 1: punctuation groups /// 2: normal word character /// >2: multi-byte word character. -static int get_mouse_class(char_u *p) +static int get_mouse_class(char *p) { - if (MB_BYTE2LEN(p[0]) > 1) { + if (MB_BYTE2LEN((uint8_t)p[0]) > 1) { return mb_get_class(p); } - const int c = *p; + const int c = (uint8_t)(*p); if (c == ' ' || c == '\t') { return 0; } @@ -90,12 +90,12 @@ static void find_start_of_word(pos_T *pos) int col; line = (char_u *)ml_get(pos->lnum); - cclass = get_mouse_class(line + pos->col); + cclass = get_mouse_class((char *)line + pos->col); while (pos->col > 0) { col = pos->col - 1; col -= utf_head_off((char *)line, (char *)line + col); - if (get_mouse_class(line + col) != cclass) { + if (get_mouse_class((char *)line + col) != cclass) { break; } pos->col = col; @@ -115,10 +115,10 @@ static void find_end_of_word(pos_T *pos) pos->col--; pos->col -= utf_head_off((char *)line, (char *)line + pos->col); } - cclass = get_mouse_class(line + pos->col); + cclass = get_mouse_class((char *)line + pos->col); while (line[pos->col] != NUL) { col = pos->col + utfc_ptr2len((char *)line + pos->col); - if (get_mouse_class(line + col) != cclass) { + if (get_mouse_class((char *)line + col) != cclass) { if (*p_sel == 'e') { pos->col = col; } |