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);
|
xfree(keys_buf);
|
||||||
|
|
||||||
if (!get_dict) {
|
if (!get_dict) {
|
||||||
/* Return a string. */
|
// Return a string.
|
||||||
if (rhs != NULL)
|
if (rhs != NULL) {
|
||||||
rettv->vval.v_string = str2special_save(rhs, FALSE);
|
rettv->vval.v_string = (char_u *)str2special_save(
|
||||||
|
(const char *)rhs, false);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
tv_dict_alloc_ret(rettv);
|
tv_dict_alloc_ret(rettv);
|
||||||
@ -12154,7 +12156,7 @@ void mapblock_fill_dict(dict_T *const dict,
|
|||||||
bool compatible)
|
bool compatible)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
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);
|
char *const mapmode = map_mode_to_chars(mp->m_mode);
|
||||||
varnumber_T noremap_value;
|
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;
|
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_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("noremap"), noremap_value);
|
||||||
tv_dict_add_nr(dict, S_LEN("expr"), mp->m_expr ? 1 : 0);
|
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
|
* <M-a> and then changing 'encoding'. Beware
|
||||||
* that 0x80 is escaped. */
|
* that 0x80 is escaped. */
|
||||||
char_u *p1 = mp->m_keys;
|
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))
|
if (has_mbyte && p2 != NULL && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
|
||||||
mlen = 0;
|
mlen = 0;
|
||||||
@ -4000,11 +4000,9 @@ int put_escstr(FILE *fd, char_u *strstart, int what)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (; *str != NUL; ++str) {
|
for (; *str != NUL; ++str) {
|
||||||
char_u *p;
|
// Check for a multi-byte character, which may contain escaped
|
||||||
|
// K_SPECIAL and CSI bytes.
|
||||||
/* Check for a multi-byte character, which may contain escaped
|
const char *p = mb_unescape((const char **)&str);
|
||||||
* K_SPECIAL and CSI bytes */
|
|
||||||
p = mb_unescape(&str);
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
while (*p != NUL)
|
while (*p != NUL)
|
||||||
if (fputc(*p++, fd) < 0)
|
if (fputc(*p++, fd) < 0)
|
||||||
|
@ -1269,7 +1269,7 @@ msg_outtrans_special (
|
|||||||
string = "<Space>";
|
string = "<Space>";
|
||||||
str++;
|
str++;
|
||||||
} else {
|
} else {
|
||||||
string = (const char *)str2special((char_u **)&str, from);
|
string = str2special((const char **)&str, from);
|
||||||
}
|
}
|
||||||
const int len = vim_strsize((char_u *)string);
|
const int len = vim_strsize((char_u *)string);
|
||||||
// Highlight special keys
|
// 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 */
|
* CTRL-V or backslash */
|
||||||
if (valuep == &p_pt) {
|
if (valuep == &p_pt) {
|
||||||
s = *valuep;
|
s = *valuep;
|
||||||
while (*s != NUL)
|
while (*s != NUL) {
|
||||||
if (put_escstr(fd, str2special(&s, FALSE), 2) == FAIL)
|
if (put_escstr(fd, (char_u *)str2special((const char **)&s, false), 2)
|
||||||
|
== FAIL) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (expand) {
|
} else if (expand) {
|
||||||
buf = xmalloc(MAXPATHL);
|
buf = xmalloc(MAXPATHL);
|
||||||
home_replace(NULL, *valuep, buf, MAXPATHL, FALSE);
|
home_replace(NULL, *valuep, buf, MAXPATHL, FALSE);
|
||||||
@ -6173,15 +6176,16 @@ option_value2string (
|
|||||||
}
|
}
|
||||||
} else { // P_STRING
|
} else { // P_STRING
|
||||||
varp = *(char_u **)(varp);
|
varp = *(char_u **)(varp);
|
||||||
if (varp == NULL) /* just in case */
|
if (varp == NULL) { // Just in case.
|
||||||
NameBuff[0] = NUL;
|
NameBuff[0] = NUL;
|
||||||
else if (opp->flags & P_EXPAND)
|
} else if (opp->flags & P_EXPAND) {
|
||||||
home_replace(NULL, varp, NameBuff, MAXPATHL, FALSE);
|
home_replace(NULL, varp, NameBuff, MAXPATHL, false);
|
||||||
/* Translate 'pastetoggle' into special key names */
|
// Translate 'pastetoggle' into special key names.
|
||||||
else if ((char_u **)opp->var == &p_pt)
|
} else if ((char_u **)opp->var == &p_pt) {
|
||||||
str2specialbuf(p_pt, NameBuff, MAXPATHL);
|
str2specialbuf((const char *)p_pt, (char *)NameBuff, MAXPATHL);
|
||||||
else
|
} else {
|
||||||
STRLCPY(NameBuff, varp, MAXPATHL);
|
STRLCPY(NameBuff, varp, MAXPATHL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user