mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.0650: Vim9: script function can be deleted
Problem: Vim9: script function can be deleted. Solution: Disallow deleting script function. Delete functions when sourcing a script again.
This commit is contained in:
@@ -1275,6 +1275,7 @@ do_source(
|
||||
hashitem_T *hi;
|
||||
dictitem_T *di;
|
||||
int todo;
|
||||
int is_vim9 = si->sn_version == SCRIPT_VERSION_VIM9;
|
||||
|
||||
// loading the same script again
|
||||
si->sn_had_command = FALSE;
|
||||
@@ -1293,6 +1294,10 @@ do_source(
|
||||
|
||||
// old imports are no longer valid
|
||||
free_imports(sid);
|
||||
|
||||
// in Vim9 script functions are marked deleted
|
||||
if (is_vim9)
|
||||
delete_script_functions(sid);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user