mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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:
30
src/eval.c
30
src/eval.c
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user