mirror of
https://github.com/vim/vim.git
synced 2025-09-06 21:53:38 -04:00
patch 8.2.4365: sticky command modifiers are too sticky
Problem: sticky command modifiers are too sticky. Solution: Do not apply command modifiers to a called function. (closes #9751)
This commit is contained in:
parent
4549166078
commit
cdf0485969
@ -118,6 +118,20 @@ def Test_cmdmod_execute()
|
|||||||
END
|
END
|
||||||
v9.CheckScriptSuccess(lines)
|
v9.CheckScriptSuccess(lines)
|
||||||
delete('Xvim9import.vim')
|
delete('Xvim9import.vim')
|
||||||
|
|
||||||
|
# "legacy" does not aply to a called function
|
||||||
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
|
||||||
|
def g:TheFunc()
|
||||||
|
if exists('something')
|
||||||
|
echo 'yes'
|
||||||
|
endif
|
||||||
|
enddef
|
||||||
|
legacy exe 'call g:TheFunc()'
|
||||||
|
END
|
||||||
|
v9.CheckScriptSuccess(lines)
|
||||||
|
delfunc g:TheFunc
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_edit_wildcards()
|
def Test_edit_wildcards()
|
||||||
|
@ -2513,6 +2513,7 @@ call_user_func(
|
|||||||
{
|
{
|
||||||
sctx_T save_current_sctx;
|
sctx_T save_current_sctx;
|
||||||
int using_sandbox = FALSE;
|
int using_sandbox = FALSE;
|
||||||
|
int save_sticky_cmdmod_flags = sticky_cmdmod_flags;
|
||||||
funccall_T *fc;
|
funccall_T *fc;
|
||||||
int save_did_emsg;
|
int save_did_emsg;
|
||||||
int default_arg_err = FALSE;
|
int default_arg_err = FALSE;
|
||||||
@ -2569,6 +2570,7 @@ call_user_func(
|
|||||||
if (do_profiling == PROF_YES)
|
if (do_profiling == PROF_YES)
|
||||||
profile_may_start_func(&profile_info, fp, caller);
|
profile_may_start_func(&profile_info, fp, caller);
|
||||||
#endif
|
#endif
|
||||||
|
sticky_cmdmod_flags = 0;
|
||||||
call_def_function(fp, argcount, argvars, funcexe->fe_partial, rettv);
|
call_def_function(fp, argcount, argvars, funcexe->fe_partial, rettv);
|
||||||
funcdepth_decrement();
|
funcdepth_decrement();
|
||||||
#ifdef FEAT_PROFILE
|
#ifdef FEAT_PROFILE
|
||||||
@ -2578,6 +2580,7 @@ call_user_func(
|
|||||||
#endif
|
#endif
|
||||||
current_funccal = fc->caller;
|
current_funccal = fc->caller;
|
||||||
free_funccal(fc);
|
free_funccal(fc);
|
||||||
|
sticky_cmdmod_flags = save_sticky_cmdmod_flags;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2797,6 +2800,9 @@ call_user_func(
|
|||||||
fc->caller == NULL ? NULL : fc->caller->func);
|
fc->caller == NULL ? NULL : fc->caller->func);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// "legacy" does not apply to commands in the function
|
||||||
|
sticky_cmdmod_flags = 0;
|
||||||
|
|
||||||
save_current_sctx = current_sctx;
|
save_current_sctx = current_sctx;
|
||||||
current_sctx = fp->uf_script_ctx;
|
current_sctx = fp->uf_script_ctx;
|
||||||
save_did_emsg = did_emsg;
|
save_did_emsg = did_emsg;
|
||||||
@ -2889,6 +2895,7 @@ call_user_func(
|
|||||||
#endif
|
#endif
|
||||||
if (using_sandbox)
|
if (using_sandbox)
|
||||||
--sandbox;
|
--sandbox;
|
||||||
|
sticky_cmdmod_flags = save_sticky_cmdmod_flags;
|
||||||
|
|
||||||
if (p_verbose >= 12 && SOURCING_NAME != NULL)
|
if (p_verbose >= 12 && SOURCING_NAME != NULL)
|
||||||
{
|
{
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4365,
|
||||||
/**/
|
/**/
|
||||||
4364,
|
4364,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user