mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -2191,7 +2191,7 @@ static int get_mouse_class(char_u *p)
|
||||
// characters to be considered as a single word. These are things like
|
||||
// "->", "/ *", "*=", "+=", "&=", "<=", ">=", "!=" etc. Otherwise, each
|
||||
// character is in its own class.
|
||||
if (c != NUL && vim_strchr((char_u *)"-+*/%<>&|^!=", c) != NULL) {
|
||||
if (c != NUL && vim_strchr("-+*/%<>&|^!=", c) != NULL) {
|
||||
return 1;
|
||||
}
|
||||
return c;
|
||||
@@ -3447,7 +3447,7 @@ dozet:
|
||||
// and "zC" only in Visual mode. "zj" and "zk" are motion
|
||||
// commands.
|
||||
if (cap->nchar != 'f' && cap->nchar != 'F'
|
||||
&& !(VIsual_active && vim_strchr((char_u *)"dcCoO", cap->nchar))
|
||||
&& !(VIsual_active && vim_strchr("dcCoO", cap->nchar))
|
||||
&& cap->nchar != 'j' && cap->nchar != 'k'
|
||||
&& checkclearop(cap->oap)) {
|
||||
return;
|
||||
@@ -3455,7 +3455,7 @@ dozet:
|
||||
|
||||
// For "z+", "z<CR>", "zt", "z.", "zz", "z^", "z-", "zb":
|
||||
// If line number given, set cursor.
|
||||
if ((vim_strchr((char_u *)"+\r\nt.z^-b", nchar) != NULL)
|
||||
if ((vim_strchr("+\r\nt.z^-b", nchar) != NULL)
|
||||
&& cap->count0
|
||||
&& cap->count0 != curwin->w_cursor.lnum) {
|
||||
setpcmark();
|
||||
@@ -3800,7 +3800,7 @@ dozet:
|
||||
no_mapping--;
|
||||
allow_keys--;
|
||||
(void)add_to_showcmd(nchar);
|
||||
if (vim_strchr((char_u *)"gGwW", nchar) == NULL) {
|
||||
if (vim_strchr("gGwW", nchar) == NULL) {
|
||||
clearopbeep(cap->oap);
|
||||
break;
|
||||
}
|
||||
@@ -4234,7 +4234,7 @@ static void nv_ident(cmdarg_T *cap)
|
||||
p = (char_u *)buf + STRLEN(buf);
|
||||
while (n-- > 0) {
|
||||
// put a backslash before \ and some others
|
||||
if (vim_strchr(aux_ptr, *ptr) != NULL) {
|
||||
if (vim_strchr((char *)aux_ptr, *ptr) != NULL) {
|
||||
*p++ = '\\';
|
||||
}
|
||||
// When current byte is a part of multibyte character, copy all
|
||||
@@ -4434,9 +4434,9 @@ static void nv_right(cmdarg_T *cap)
|
||||
// <Space> wraps to next line if 'whichwrap' has 's'.
|
||||
// 'l' wraps to next line if 'whichwrap' has 'l'.
|
||||
// CURS_RIGHT wraps to next line if 'whichwrap' has '>'.
|
||||
if (((cap->cmdchar == ' ' && vim_strchr(p_ww, 's') != NULL)
|
||||
|| (cap->cmdchar == 'l' && vim_strchr(p_ww, 'l') != NULL)
|
||||
|| (cap->cmdchar == K_RIGHT && vim_strchr(p_ww, '>') != NULL))
|
||||
if (((cap->cmdchar == ' ' && vim_strchr((char *)p_ww, 's') != NULL)
|
||||
|| (cap->cmdchar == 'l' && vim_strchr((char *)p_ww, 'l') != NULL)
|
||||
|| (cap->cmdchar == K_RIGHT && vim_strchr((char *)p_ww, '>') != NULL))
|
||||
&& curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) {
|
||||
// When deleting we also count the NL as a character.
|
||||
// Set cap->oap->inclusive when last char in the line is
|
||||
@@ -4504,9 +4504,9 @@ static void nv_left(cmdarg_T *cap)
|
||||
// 'h' wraps to previous line if 'whichwrap' has 'h'.
|
||||
// CURS_LEFT wraps to previous line if 'whichwrap' has '<'.
|
||||
if ((((cap->cmdchar == K_BS || cap->cmdchar == Ctrl_H)
|
||||
&& vim_strchr(p_ww, 'b') != NULL)
|
||||
|| (cap->cmdchar == 'h' && vim_strchr(p_ww, 'h') != NULL)
|
||||
|| (cap->cmdchar == K_LEFT && vim_strchr(p_ww, '<') != NULL))
|
||||
&& vim_strchr((char *)p_ww, 'b') != NULL)
|
||||
|| (cap->cmdchar == 'h' && vim_strchr((char *)p_ww, 'h') != NULL)
|
||||
|| (cap->cmdchar == K_LEFT && vim_strchr((char *)p_ww, '<') != NULL))
|
||||
&& curwin->w_cursor.lnum > 1) {
|
||||
curwin->w_cursor.lnum--;
|
||||
coladvance(MAXCOL);
|
||||
@@ -4802,7 +4802,7 @@ static void nv_brackets(cmdarg_T *cap)
|
||||
// "[f" or "]f" : Edit file under the cursor (same as "gf")
|
||||
if (cap->nchar == 'f') {
|
||||
nv_gotofile(cap);
|
||||
} else if (vim_strchr((char_u *)"iI\011dD\004", cap->nchar) != NULL) {
|
||||
} else if (vim_strchr("iI\011dD\004", cap->nchar) != NULL) {
|
||||
// Find the occurrence(s) of the identifier or define under cursor
|
||||
// in current and included files or jump to the first occurrence.
|
||||
//
|
||||
@@ -4831,8 +4831,8 @@ static void nv_brackets(cmdarg_T *cap)
|
||||
MAXLNUM);
|
||||
curwin->w_set_curswant = true;
|
||||
}
|
||||
} else if ((cap->cmdchar == '[' && vim_strchr((char_u *)"{(*/#mM", cap->nchar) != NULL)
|
||||
|| (cap->cmdchar == ']' && vim_strchr((char_u *)"})*/#mM", cap->nchar) != NULL)) {
|
||||
} else if ((cap->cmdchar == '[' && vim_strchr("{(*/#mM", cap->nchar) != NULL)
|
||||
|| (cap->cmdchar == ']' && vim_strchr("})*/#mM", cap->nchar) != NULL)) {
|
||||
// "[{", "[(", "]}" or "])": go to Nth unclosed '{', '(', '}' or ')'
|
||||
// "[#", "]#": go to start/end of Nth innermost #if..#endif construct.
|
||||
// "[/", "[*", "]/", "]*": go to Nth comment start/end.
|
||||
@@ -5403,7 +5403,7 @@ static void n_swapchar(cmdarg_T *cap)
|
||||
return;
|
||||
}
|
||||
|
||||
if (LINEEMPTY(curwin->w_cursor.lnum) && vim_strchr(p_ww, '~') == NULL) {
|
||||
if (LINEEMPTY(curwin->w_cursor.lnum) && vim_strchr((char *)p_ww, '~') == NULL) {
|
||||
clearopbeep(cap->oap);
|
||||
return;
|
||||
}
|
||||
@@ -5419,7 +5419,7 @@ static void n_swapchar(cmdarg_T *cap)
|
||||
did_change |= swapchar(cap->oap->op_type, &curwin->w_cursor);
|
||||
inc_cursor();
|
||||
if (gchar_cursor() == NUL) {
|
||||
if (vim_strchr(p_ww, '~') != NULL
|
||||
if (vim_strchr((char *)p_ww, '~') != NULL
|
||||
&& curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) {
|
||||
curwin->w_cursor.lnum++;
|
||||
curwin->w_cursor.col = 0;
|
||||
@@ -5491,7 +5491,7 @@ static void v_visop(cmdarg_T *cap)
|
||||
curwin->w_curswant = MAXCOL;
|
||||
}
|
||||
}
|
||||
cap->cmdchar = *(vim_strchr(trans, cap->cmdchar) + 1);
|
||||
cap->cmdchar = (uint8_t)(*(vim_strchr((char *)trans, cap->cmdchar) + 1));
|
||||
nv_operator(cap);
|
||||
}
|
||||
|
||||
@@ -5754,7 +5754,8 @@ void start_selection(void)
|
||||
/// When "c" is 'o' (checking for "mouse") then also when mapped.
|
||||
void may_start_select(int c)
|
||||
{
|
||||
VIsual_select = (c == 'o' || (stuff_empty() && typebuf_typed())) && vim_strchr(p_slm, c) != NULL;
|
||||
VIsual_select = (c == 'o' || (stuff_empty() && typebuf_typed()))
|
||||
&& vim_strchr((char *)p_slm, c) != NULL;
|
||||
}
|
||||
|
||||
/// Start Visual mode "c".
|
||||
|
Reference in New Issue
Block a user