patch 8.2.3829: no error when setting a func option to script-local function
Problem: No error when setting a func option to a script-local function.
Solution: Give an error if the name starts with "s:". (closes #9358)
diff --git a/src/option.c b/src/option.c
index 739b29a..de6e562 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7199,6 +7199,9 @@
return OK;
}
+ if (STRNCMP(optval, "s:", 2) == 0 && !SCRIPT_ID_VALID(current_sctx.sc_sid))
+ return FAIL;
+
if (*optval == '{' || (in_vim9script() && *optval == '(')
|| (STRNCMP(optval, "function(", 9) == 0)
|| (STRNCMP(optval, "funcref(", 8) == 0))