mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -964,7 +964,7 @@ static int get_map_mode(char **cmdp, bool forceit)
|
||||
/// Clear all mappings (":mapclear") or abbreviations (":abclear").
|
||||
/// "abbr" should be false for mappings, true for abbreviations.
|
||||
/// This function used to be called map_clear().
|
||||
static void do_mapclear(char_u *cmdp, char_u *arg, int forceit, int abbr)
|
||||
static void do_mapclear(char *cmdp, char_u *arg, int forceit, int abbr)
|
||||
{
|
||||
int mode;
|
||||
int local;
|
||||
@@ -975,7 +975,7 @@ static void do_mapclear(char_u *cmdp, char_u *arg, int forceit, int abbr)
|
||||
return;
|
||||
}
|
||||
|
||||
mode = get_map_mode((char **)&cmdp, forceit);
|
||||
mode = get_map_mode(&cmdp, forceit);
|
||||
map_clear_mode(curbuf, mode, local, abbr);
|
||||
}
|
||||
|
||||
@@ -1051,9 +1051,9 @@ bool map_to_exists(const char *const str, const char *const modechars, const boo
|
||||
int mode = 0;
|
||||
int retval;
|
||||
|
||||
char_u *buf = NULL;
|
||||
char *buf = NULL;
|
||||
const char_u *const rhs = (char_u *)replace_termcodes(str, strlen(str),
|
||||
(char **)&buf, REPTERM_DO_LT,
|
||||
&buf, REPTERM_DO_LT,
|
||||
NULL, CPO_TO_CPO_FLAGS);
|
||||
|
||||
#define MAPMODE(mode, modechars, chr, modeflags) \
|
||||
@@ -1194,14 +1194,14 @@ static char_u *translate_mapping(char_u *str, int cpo_flags)
|
||||
/// @param forceit true if '!' given
|
||||
/// @param isabbrev true if abbreviation
|
||||
/// @param isunmap true if unmap/unabbrev command
|
||||
char_u *set_context_in_map_cmd(expand_T *xp, char_u *cmd, char_u *arg, bool forceit, bool isabbrev,
|
||||
char_u *set_context_in_map_cmd(expand_T *xp, char *cmd, char_u *arg, bool forceit, bool isabbrev,
|
||||
bool isunmap, cmdidx_T cmdidx)
|
||||
{
|
||||
if (forceit && cmdidx != CMD_map && cmdidx != CMD_unmap) {
|
||||
xp->xp_context = EXPAND_NOTHING;
|
||||
} else {
|
||||
if (isunmap) {
|
||||
expand_mapmodes = get_map_mode((char **)&cmd, forceit || isabbrev);
|
||||
expand_mapmodes = get_map_mode(&cmd, forceit || isabbrev);
|
||||
} else {
|
||||
expand_mapmodes = MODE_INSERT | MODE_CMDLINE;
|
||||
if (!isabbrev) {
|
||||
@@ -2079,7 +2079,7 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
|
||||
}
|
||||
|
||||
char *keys_buf = NULL;
|
||||
char_u *alt_keys_buf = NULL;
|
||||
char *alt_keys_buf = NULL;
|
||||
bool did_simplify = false;
|
||||
const int flags = REPTERM_FROM_PART | REPTERM_DO_LT;
|
||||
const int mode = get_map_mode((char **)&which, 0);
|
||||
@@ -2096,9 +2096,9 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
|
||||
// preferred for printing, like in do_map().
|
||||
(void)replace_termcodes(keys,
|
||||
STRLEN(keys),
|
||||
(char **)&alt_keys_buf, flags | REPTERM_NO_SIMPLIFY, NULL,
|
||||
&alt_keys_buf, flags | REPTERM_NO_SIMPLIFY, NULL,
|
||||
CPO_TO_CPO_FLAGS);
|
||||
rhs = check_map(alt_keys_buf, mode, exact, false, abbr, &mp, &buffer_local, &rhs_lua);
|
||||
rhs = check_map((char_u *)alt_keys_buf, mode, exact, false, abbr, &mp, &buffer_local, &rhs_lua);
|
||||
}
|
||||
|
||||
if (!get_dict) {
|
||||
@@ -2439,13 +2439,13 @@ void ex_unmap(exarg_T *eap)
|
||||
/// ":mapclear" and friends.
|
||||
void ex_mapclear(exarg_T *eap)
|
||||
{
|
||||
do_mapclear((char_u *)eap->cmd, (char_u *)eap->arg, eap->forceit, false);
|
||||
do_mapclear(eap->cmd, (char_u *)eap->arg, eap->forceit, false);
|
||||
}
|
||||
|
||||
/// ":abclear" and friends.
|
||||
void ex_abclear(exarg_T *eap)
|
||||
{
|
||||
do_mapclear((char_u *)eap->cmd, (char_u *)eap->arg, true, true);
|
||||
do_mapclear(eap->cmd, (char_u *)eap->arg, true, true);
|
||||
}
|
||||
|
||||
/// Set, tweak, or remove a mapping in a mode. Acts as the implementation for
|
||||
|
Reference in New Issue
Block a user