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.
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index ac9bb4c..a215667 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -2771,5 +2771,10 @@
call assert_fails('call extend(g:, #{bar: { -> "foo" }}, "force")', 'E704:')
endfunc
+func Test_funcref_to_string()
+ let Fn = funcref('g:Test_funcref_to_string')
+ call assert_equal("function('g:Test_funcref_to_string')", string(Fn))
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab