Problem: sticky command modifiers are too sticky.
Solution: Do not apply command modifiers to a sourced script. (closes #9751)
#ifdef FEAT_PROFILE
proftime_T wait_start;
#endif
+ int save_sticky_cmdmod_flags = sticky_cmdmod_flags;
int trigger_source_post = FALSE;
ESTACK_CHECK_DECLARATION
time_push(&tv_rel, &tv_start);
#endif
+ // "legacy" does not apply to commands in the script
+ sticky_cmdmod_flags = 0;
+
save_current_sctx = current_sctx;
current_sctx.sc_version = 1; // default script version
theend:
vim_free(fname_exp);
+ sticky_cmdmod_flags = save_sticky_cmdmod_flags;
#ifdef FEAT_EVAL
estack_compiling = save_estack_compiling;
#endif
unlet b:undo
unlet g:undone
unlet g:undtwo
+
+ # "legacy" does not apply to a loaded script
+ lines =<< trim END
+ vim9script
+ export var exported = 'x'
+ END
+ writefile(lines, 'Xvim9import.vim')
+ lines =<< trim END
+ legacy exe "import './Xvim9import.vim'"
+ END
+ v9.CheckScriptSuccess(lines)
+ delete('Xvim9import.vim')
enddef
def Test_edit_wildcards()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4357,
/**/
4356,
/**/