vim-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.

c4ec338fb8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
This commit is contained in:
zeertzjq
2025-12-19 15:27:09 +08:00
parent eac2f0443e
commit f15c28ed7a
6 changed files with 26 additions and 10 deletions

View File

@@ -453,7 +453,7 @@ static bool typval_conv_special = false;
lua_pushlstring(lstate, blob_ != NULL ? blob_->bv_ga.ga_data : "", (size_t)(len)); \
} while (0)
#define TYPVAL_ENCODE_CONV_FUNC_START(tv, fun) \
#define TYPVAL_ENCODE_CONV_FUNC_START(tv, fun, prefix) \
do { \
ufunc_T *fp = find_func(fun); \
if (fp != NULL && fp->uf_flags & FC_LUAREF) { \