mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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)
This commit is contained in:
@@ -7199,6 +7199,9 @@ option_set_callback_func(char_u *optval UNUSED, callback_T *optcb UNUSED)
|
||||
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))
|
||||
|
Reference in New Issue
Block a user