Mercurial > vim
comparison src/scriptfile.c @ 23886:eef0cffbdb94 v8.2.2485
patch 8.2.2485: when sourcing a script again the script version isn't reset
Commit: https://github.com/vim/vim/commit/0123cc1e1422003704cc6941916dd75e61fb7976
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 7 17:17:58 2021 +0100
patch 8.2.2485: when sourcing a script again the script version isn't reset
Problem: When sourcing a script again the script version isn't reset.
Solution: Set sn_version to one when sourcing a script again. Clear
sn_save_cpo properly. (closes #7608)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Feb 2021 17:30:04 +0100 |
parents | dc3b7a31c29f |
children | a9ff8368d35f |
comparison
equal
deleted
inserted
replaced
23885:8ea16fd1a3ba | 23886:eef0cffbdb94 |
---|---|
1317 di = HI2DI(hi); | 1317 di = HI2DI(hi); |
1318 di->di_flags |= DI_FLAGS_RELOAD; | 1318 di->di_flags |= DI_FLAGS_RELOAD; |
1319 } | 1319 } |
1320 // imports can be redefined once | 1320 // imports can be redefined once |
1321 mark_imports_for_reload(sid); | 1321 mark_imports_for_reload(sid); |
1322 | |
1323 // reset version, "vim9script" may have been added or removed. | |
1324 si->sn_version = 1; | |
1322 } | 1325 } |
1323 else | 1326 else |
1324 { | 1327 { |
1325 // It's new, generate a new SID. | 1328 // It's new, generate a new SID. |
1326 current_sctx.sc_sid = ++last_current_SID; | 1329 current_sctx.sc_sid = ++last_current_SID; |
1455 // Get "si" again, "script_items" may have been reallocated. | 1458 // Get "si" again, "script_items" may have been reallocated. |
1456 si = SCRIPT_ITEM(current_sctx.sc_sid); | 1459 si = SCRIPT_ITEM(current_sctx.sc_sid); |
1457 if (si->sn_save_cpo != NULL) | 1460 if (si->sn_save_cpo != NULL) |
1458 { | 1461 { |
1459 set_option_value((char_u *)"cpo", 0L, si->sn_save_cpo, 0); | 1462 set_option_value((char_u *)"cpo", 0L, si->sn_save_cpo, 0); |
1460 CLEAR_POINTER(si->sn_save_cpo); | 1463 VIM_CLEAR(si->sn_save_cpo); |
1461 } | 1464 } |
1462 | 1465 |
1463 restore_funccal(); | 1466 restore_funccal(); |
1464 # ifdef FEAT_PROFILE | 1467 # ifdef FEAT_PROFILE |
1465 if (do_profiling == PROF_YES) | 1468 if (do_profiling == PROF_YES) |