0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1824: Vim9: variables at the script level escape their scope

Problem:    Vim9: variables at the script level escape their scope.
Solution:   When leaving a scope remove variables declared in it.
This commit is contained in:
Bram Moolenaar
2020-10-10 19:07:09 +02:00
parent 28f224b2c1
commit fcdc5d83fb
6 changed files with 112 additions and 14 deletions

View File

@@ -889,6 +889,8 @@ typedef struct {
} cs_pend;
void *cs_forinfo[CSTACK_LEN]; // info used by ":for"
int cs_line[CSTACK_LEN]; // line nr of ":while"/":for" line
int cs_script_var_len[CSTACK_LEN]; // value of sn_var_vals.ga_len
// when entering the block
int cs_idx; // current entry, or -1 if none
int cs_looplevel; // nr of nested ":while"s and ":for"s
int cs_trylevel; // nr of nested ":try"s