summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-12 13:26:03 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-12 13:26:03 +0100
commit2b6185287adf53343ed5f49e967ae402c64063e4 (patch)
treec20885e2be00d5dcf7bcfd9cff1c2aee966a4de7 /src/ex_cmds2.c
parentc3c3158756ae074052b0db2a3e3a7ba192df5330 (diff)
patch 8.1.0729: there is a SourcePre autocommand event but not a SourcePostv8.1.0729
Problem: There is a SourcePre autocommand event but not a SourcePost. Solution: Add the SourcePost autocommand event. (closes #3739)
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 74d56427cd..4d48c1beb5 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;