0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4657: errors for functions are sometimes hard to read

Problem:    Errors for functions are sometimes hard to read.
Solution:   Use printable_func_name() in more places.
This commit is contained in:
Bram Moolenaar
2022-03-31 20:02:56 +01:00
parent ccbfd4883f
commit a6c18d38ca
9 changed files with 68 additions and 36 deletions

View File

@@ -5296,15 +5296,29 @@ echo_string_core(
break;
case VAR_FUNC:
if (echo_style)
{
*tofree = NULL;
r = tv->vval.v_string;
}
else
{
*tofree = string_quote(tv->vval.v_string, TRUE);
r = *tofree;
char_u buf[MAX_FUNC_NAME_LEN];
if (echo_style)
{
r = make_ufunc_name_readable(tv->vval.v_string,
buf, MAX_FUNC_NAME_LEN);
if (r == buf)
{
r = vim_strsave(buf);
*tofree = r;
}
else
*tofree = NULL;
}
else
{
*tofree = string_quote(tv->vval.v_string == NULL ? NULL
: make_ufunc_name_readable(
tv->vval.v_string, buf, MAX_FUNC_NAME_LEN),
TRUE);
r = *tofree;
}
}
break;