forked from aniani/vim
patch 8.1.0729: there is a SourcePre autocommand event but not a SourcePost
Problem: There is a SourcePre autocommand event but not a SourcePost. Solution: Add the SourcePost autocommand event. (closes #3739)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user