mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.3766: converting a funcref to a string leaves out "g:"
Problem: Converting a funcref to a string leaves out "g:", causing the meaning of the name depending on the context. Solution: Prepend "g:" for a global function.
This commit is contained in:
10
src/eval.c
10
src/eval.c
@@ -5006,7 +5006,15 @@ echo_string_core(
|
||||
ga_concat(&ga, (char_u *)"function(");
|
||||
if (fname != NULL)
|
||||
{
|
||||
ga_concat(&ga, fname);
|
||||
// When using uf_name prepend "g:" for a global function.
|
||||
if (pt->pt_name == NULL && fname[0] == '\''
|
||||
&& vim_isupper(fname[1]))
|
||||
{
|
||||
ga_concat(&ga, (char_u *)"'g:");
|
||||
ga_concat(&ga, fname + 1);
|
||||
}
|
||||
else
|
||||
ga_concat(&ga, fname);
|
||||
vim_free(fname);
|
||||
}
|
||||
if (pt != NULL && pt->pt_argc > 0)
|
||||
|
Reference in New Issue
Block a user