diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-27 22:47:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-27 22:47:51 +0200 |
commit | 4c17ad94ecb0a0fb26d6fface2614bc5172dea18 (patch) | |
tree | 3b26b172e38be6c1d762c58d7517ac79e21e0a0f /src/scriptfile.c | |
parent | db93495d276642f63f80471fbcb900b9aa1e9e42 (diff) | |
download | vim-git-4c17ad94ecb0a0fb26d6fface2614bc5172dea18.tar.gz |
patch 8.2.0650: Vim9: script function can be deletedv8.2.0650
Problem: Vim9: script function can be deleted.
Solution: Disallow deleting script function. Delete functions when sourcing
a script again.
Diffstat (limited to 'src/scriptfile.c')
-rw-r--r-- | src/scriptfile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c index 3b7652d1f..0756116b1 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -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 { |