diff options
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 74d56427c..4d48c1beb 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -4360,6 +4360,7 @@ do_source( #ifdef FEAT_PROFILE proftime_T wait_start; #endif + int trigger_source_post = FALSE; p = expand_env_save(fname); if (p == NULL) @@ -4384,6 +4385,10 @@ do_source( #else retval = OK; #endif + if (retval == OK) + // Apply SourcePost autocommands. + apply_autocmds(EVENT_SOURCEPOST, fname_exp, fname_exp, + FALSE, curbuf); goto theend; } @@ -4653,6 +4658,9 @@ do_source( } #endif + if (!got_int) + trigger_source_post = TRUE; + #ifdef FEAT_EVAL /* * After a "finish" in debug mode, need to break at first command of next @@ -4679,6 +4687,10 @@ almosttheend: convert_setup(&cookie.conv, NULL, NULL); #endif + if (trigger_source_post) + apply_autocmds(EVENT_SOURCEPOST, si->sn_name, si->sn_name, + FALSE, curbuf); + theend: vim_free(fname_exp); return retval; |