0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2222: Vim9: cannot keep script variables when reloading

Problem:    Vim9: cannot keep script variables when reloading.
Solution:   Add the "noclear" argument to :vim9script.
This commit is contained in:
Bram Moolenaar
2020-12-26 15:39:31 +01:00
parent b0ac4ea5e1
commit 2b32700dab
8 changed files with 161 additions and 48 deletions

View File

@@ -1821,7 +1821,7 @@ typedef struct
int sn_last_block_id; // Unique ID for each script block
int sn_version; // :scriptversion
int sn_had_command; // TRUE if any command was executed
int sn_state; // SN_STATE_ values
char_u *sn_save_cpo; // 'cpo' value when :vim9script found
# ifdef FEAT_PROFILE
@@ -1845,6 +1845,10 @@ typedef struct
# endif
} scriptitem_T;
#define SN_STATE_NEW 0 // newly loaded script, nothing done
#define SN_STATE_RELOAD 1 // script loaded before, nothing done
#define SN_STATE_HAD_COMMAND 9 // a command was executed
// Struct passed through eval() functions.
// See EVALARG_EVALUATE for a fixed value with eval_flags set to EVAL_EVALUATE.
typedef struct {