Mercurial > vim
comparison src/scriptfile.c @ 20189:63cc54100ae4 v8.2.0650
patch 8.2.0650: Vim9: script function can be deleted
Commit: https://github.com/vim/vim/commit/4c17ad94ecb0a0fb26d6fface2614bc5172dea18
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 27 22:47:51 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 27 Apr 2020 23:00:03 +0200 |
parents | d13f8ae3b1de |
children | d821c03b890c |
comparison
equal
deleted
inserted
replaced
20188:085eb4da46f4 | 20189:63cc54100ae4 |
---|---|
1273 { | 1273 { |
1274 hashtab_T *ht; | 1274 hashtab_T *ht; |
1275 hashitem_T *hi; | 1275 hashitem_T *hi; |
1276 dictitem_T *di; | 1276 dictitem_T *di; |
1277 int todo; | 1277 int todo; |
1278 int is_vim9 = si->sn_version == SCRIPT_VERSION_VIM9; | |
1278 | 1279 |
1279 // loading the same script again | 1280 // loading the same script again |
1280 si->sn_had_command = FALSE; | 1281 si->sn_had_command = FALSE; |
1281 si->sn_version = 1; | 1282 si->sn_version = 1; |
1282 current_sctx.sc_sid = sid; | 1283 current_sctx.sc_sid = sid; |
1291 di->di_flags |= DI_FLAGS_RELOAD; | 1292 di->di_flags |= DI_FLAGS_RELOAD; |
1292 } | 1293 } |
1293 | 1294 |
1294 // old imports are no longer valid | 1295 // old imports are no longer valid |
1295 free_imports(sid); | 1296 free_imports(sid); |
1297 | |
1298 // in Vim9 script functions are marked deleted | |
1299 if (is_vim9) | |
1300 delete_script_functions(sid); | |
1296 } | 1301 } |
1297 else | 1302 else |
1298 { | 1303 { |
1299 // It's new, generate a new SID. | 1304 // It's new, generate a new SID. |
1300 current_sctx.sc_sid = ++last_current_SID; | 1305 current_sctx.sc_sid = ++last_current_SID; |