aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-01-14 08:58:28 +0100
committerGitHub <noreply@github.com>2023-01-14 15:58:28 +0800
commite89c39d6f016a4140293755250e968e839009617 (patch)
treef5dc79208bd54132ea364511c559f83bc9cd1e95 /src/nvim/normal.c
parent9220755302317e8030c5bbf334357c0d64df9fa4 (diff)
downloadrneovim-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/normal.c')
-rw-r--r--src/nvim/normal.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index cf5af66ddd..8f4240c062 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1586,7 +1586,7 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol, char **text
if ((find_type & FIND_EVAL) && ptr[col] == ']') {
break;
}
- this_class = mb_get_class((char_u *)ptr + col);
+ this_class = mb_get_class(ptr + col);
if (this_class != 0 && (i == 1 || this_class != 1)) {
break;
}
@@ -1601,13 +1601,13 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol, char **text
//
// Remember class of character under cursor.
if ((find_type & FIND_EVAL) && ptr[col] == ']') {
- this_class = mb_get_class((char_u *)"a");
+ this_class = mb_get_class("a");
} else {
- this_class = mb_get_class((char_u *)ptr + col);
+ this_class = mb_get_class(ptr + col);
}
while (col > 0 && this_class != 0) {
prevcol = col - 1 - utf_head_off(ptr, ptr + col - 1);
- prev_class = mb_get_class((char_u *)ptr + prevcol);
+ prev_class = mb_get_class(ptr + prevcol);
if (this_class != prev_class
&& (i == 0
|| prev_class == 0
@@ -1650,11 +1650,11 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol, char **text
startcol -= col;
col = 0;
// Search for point of changing multibyte character class.
- this_class = mb_get_class((char_u *)ptr);
+ this_class = mb_get_class(ptr);
while (ptr[col] != NUL // -V781
&& ((i == 0
- ? mb_get_class((char_u *)ptr + col) == this_class
- : mb_get_class((char_u *)ptr + col) != 0)
+ ? mb_get_class(ptr + col) == this_class
+ : mb_get_class(ptr + col) != 0)
|| ((find_type & FIND_EVAL)
&& col <= (int)startcol
&& find_is_eval_item((char_u *)ptr + col, &col, &bn, FORWARD)))) {
@@ -2401,7 +2401,7 @@ bool find_decl(char_u *ptr, size_t len, bool locally, bool thisblock, int flags_
/// @return true if able to move cursor, false otherwise.
static bool nv_screengo(oparg_T *oap, int dir, long dist)
{
- int linelen = linetabsize((char_u *)get_cursor_line_ptr());
+ int linelen = linetabsize(get_cursor_line_ptr());
bool retval = true;
bool atend = false;
int n;
@@ -2472,7 +2472,7 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
}
curwin->w_cursor.lnum--;
- linelen = linetabsize((char_u *)get_cursor_line_ptr());
+ linelen = linetabsize(get_cursor_line_ptr());
if (linelen > width1) {
int w = (((linelen - width1 - 1) / width2) + 1) * width2;
assert(curwin->w_curswant <= INT_MAX - w);
@@ -2508,7 +2508,7 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
if (curwin->w_curswant >= width1) {
curwin->w_curswant -= width2;
}
- linelen = linetabsize((char_u *)get_cursor_line_ptr());
+ linelen = linetabsize(get_cursor_line_ptr());
}
}
}
@@ -3549,7 +3549,7 @@ static void nv_ident(cmdarg_T *cap)
// Execute the command.
if (cmdchar == '*' || cmdchar == '#') {
if (!g_cmd
- && vim_iswordp((char *)mb_prevptr((char_u *)get_cursor_line_ptr(), (char_u *)ptr))) {
+ && vim_iswordp(mb_prevptr(get_cursor_line_ptr(), ptr))) {
STRCAT(buf, "\\>");
}
@@ -4530,7 +4530,7 @@ static void nv_replace(cmdarg_T *cap)
// Abort if not enough characters to replace.
ptr = get_cursor_pos_ptr();
if (strlen(ptr) < (unsigned)cap->count1
- || (mb_charlen((char_u *)ptr) < cap->count1)) {
+ || (mb_charlen(ptr) < cap->count1)) {
clearopbeep(cap->oap);
return;
}
@@ -5448,7 +5448,7 @@ static void nv_g_cmd(cmdarg_T *cap)
case 'M':
oap->motion_type = kMTCharWise;
oap->inclusive = false;
- i = linetabsize((char_u *)get_cursor_line_ptr());
+ i = linetabsize(get_cursor_line_ptr());
if (cap->count0 > 0 && cap->count0 <= 100) {
coladvance((colnr_T)(i * cap->count0 / 100));
} else {