mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
*: Adjust usages of modified functions
This commit is contained in:
parent
832c158a66
commit
6140396d97
@ -12117,9 +12117,11 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
|
||||
xfree(keys_buf);
|
||||
|
||||
if (!get_dict) {
|
||||
/* Return a string. */
|
||||
if (rhs != NULL)
|
||||
rettv->vval.v_string = str2special_save(rhs, FALSE);
|
||||
// Return a string.
|
||||
if (rhs != NULL) {
|
||||
rettv->vval.v_string = (char_u *)str2special_save(
|
||||
(const char *)rhs, false);
|
||||
}
|
||||
|
||||
} else {
|
||||
tv_dict_alloc_ret(rettv);
|
||||
@ -12154,7 +12156,7 @@ void mapblock_fill_dict(dict_T *const dict,
|
||||
bool compatible)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
char_u *lhs = str2special_save(mp->m_keys, true);
|
||||
char *const lhs = str2special_save((const char *)mp->m_keys, true);
|
||||
char *const mapmode = map_mode_to_chars(mp->m_mode);
|
||||
varnumber_T noremap_value;
|
||||
|
||||
@ -12168,7 +12170,7 @@ void mapblock_fill_dict(dict_T *const dict,
|
||||
noremap_value = mp->m_noremap == REMAP_SCRIPT ? 2 : !!mp->m_noremap;
|
||||
}
|
||||
|
||||
tv_dict_add_str(dict, S_LEN("lhs"), (const char *)lhs);
|
||||
tv_dict_add_str(dict, S_LEN("lhs"), lhs);
|
||||
tv_dict_add_str(dict, S_LEN("rhs"), (const char *)mp->m_orig_str);
|
||||
tv_dict_add_nr(dict, S_LEN("noremap"), noremap_value);
|
||||
tv_dict_add_nr(dict, S_LEN("expr"), mp->m_expr ? 1 : 0);
|
||||
|
@ -1806,7 +1806,7 @@ static int vgetorpeek(int advance)
|
||||
* <M-a> and then changing 'encoding'. Beware
|
||||
* that 0x80 is escaped. */
|
||||
char_u *p1 = mp->m_keys;
|
||||
char_u *p2 = mb_unescape(&p1);
|
||||
char_u *p2 = (char_u *)mb_unescape((const char **)&p1);
|
||||
|
||||
if (has_mbyte && p2 != NULL && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
|
||||
mlen = 0;
|
||||
@ -4000,11 +4000,9 @@ int put_escstr(FILE *fd, char_u *strstart, int what)
|
||||
}
|
||||
|
||||
for (; *str != NUL; ++str) {
|
||||
char_u *p;
|
||||
|
||||
/* Check for a multi-byte character, which may contain escaped
|
||||
* K_SPECIAL and CSI bytes */
|
||||
p = mb_unescape(&str);
|
||||
// Check for a multi-byte character, which may contain escaped
|
||||
// K_SPECIAL and CSI bytes.
|
||||
const char *p = mb_unescape((const char **)&str);
|
||||
if (p != NULL) {
|
||||
while (*p != NUL)
|
||||
if (fputc(*p++, fd) < 0)
|
||||
|
@ -1269,7 +1269,7 @@ msg_outtrans_special (
|
||||
string = "<Space>";
|
||||
str++;
|
||||
} else {
|
||||
string = (const char *)str2special((char_u **)&str, from);
|
||||
string = str2special((const char **)&str, from);
|
||||
}
|
||||
const int len = vim_strsize((char_u *)string);
|
||||
// Highlight special keys
|
||||
|
@ -5175,9 +5175,12 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, int e
|
||||
* CTRL-V or backslash */
|
||||
if (valuep == &p_pt) {
|
||||
s = *valuep;
|
||||
while (*s != NUL)
|
||||
if (put_escstr(fd, str2special(&s, FALSE), 2) == FAIL)
|
||||
while (*s != NUL) {
|
||||
if (put_escstr(fd, (char_u *)str2special((const char **)&s, false), 2)
|
||||
== FAIL) {
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
} else if (expand) {
|
||||
buf = xmalloc(MAXPATHL);
|
||||
home_replace(NULL, *valuep, buf, MAXPATHL, FALSE);
|
||||
@ -6173,17 +6176,18 @@ option_value2string (
|
||||
}
|
||||
} else { // P_STRING
|
||||
varp = *(char_u **)(varp);
|
||||
if (varp == NULL) /* just in case */
|
||||
if (varp == NULL) { // Just in case.
|
||||
NameBuff[0] = NUL;
|
||||
else if (opp->flags & P_EXPAND)
|
||||
home_replace(NULL, varp, NameBuff, MAXPATHL, FALSE);
|
||||
/* Translate 'pastetoggle' into special key names */
|
||||
else if ((char_u **)opp->var == &p_pt)
|
||||
str2specialbuf(p_pt, NameBuff, MAXPATHL);
|
||||
else
|
||||
} else if (opp->flags & P_EXPAND) {
|
||||
home_replace(NULL, varp, NameBuff, MAXPATHL, false);
|
||||
// Translate 'pastetoggle' into special key names.
|
||||
} else if ((char_u **)opp->var == &p_pt) {
|
||||
str2specialbuf((const char *)p_pt, (char *)NameBuff, MAXPATHL);
|
||||
} else {
|
||||
STRLCPY(NameBuff, varp, MAXPATHL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "varp" points to 'wildchar' or 'wildcharm' and it can be
|
||||
|
Loading…
Reference in New Issue
Block a user