diff src/eval.c @ 28461:938c174b8088 v8.2.4755

patch 8.2.4755: cannot use <SID>FuncRef in completion spec Commit: https://github.com/vim/vim/commit/12eb2eb4d78828513d91e04b0e69550ed37a5932 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 15 22:57:09 2022 +0100 patch 8.2.4755: cannot use <SID>FuncRef in completion spec Problem: Cannot use <SID>FuncRef in completion spec. Solution: Dereference a function name in another way. (closes https://github.com/vim/vim/issues/10197)
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Apr 2022 00:00:03 +0200
parents 4dcccb2673fe
children a35d54d01ade
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -639,7 +639,15 @@ deref_function_name(
 
     ref.v_type = VAR_UNKNOWN;
     if (eval7(arg, &ref, evalarg, FALSE) == FAIL)
-	return NULL;
+    {
+	dictitem_T	*v;
+
+	// If <SID>VarName was used it would not be found, try another way.
+	v = find_var_also_in_script(name, NULL, FALSE);
+	if (v == NULL)
+	    return NULL;
+	copy_tv(&v->di_tv, &ref);
+    }
     if (*skipwhite(*arg) != NUL)
     {
 	if (verbose)