mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
vim-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 vim/vim#9358)
94c785d235
Omit test: reverted in patch 8.2.3838.
Cherry-pick SCRIPT_ID_VALID from patch 8.2.1539.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -5157,6 +5157,10 @@ int option_set_callback_func(char *optval, Callback *optcb)
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (strncmp(optval, "s:", 2) == 0 && !SCRIPT_ID_VALID(current_sctx.sc_sid)) {
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
typval_T *tv;
|
||||
if (*optval == '{'
|
||||
|| (strncmp(optval, "function(", 9) == 0)
|
||||
|
Reference in New Issue
Block a user