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.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 69e3f12..156f0df 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2594,7 +2594,7 @@
// Set flag that any command was executed, used by ex_vim9script().
if (getline_equal(ea.getline, ea.cookie, getsourceline)
&& current_sctx.sc_sid > 0)
- SCRIPT_ITEM(current_sctx.sc_sid)->sn_had_command = TRUE;
+ SCRIPT_ITEM(current_sctx.sc_sid)->sn_state = SN_STATE_HAD_COMMAND;
/*
* If the command just executed called do_cmdline(), any throw or ":return"