Skip to content

Commit

Permalink
patch 8.2.3306: unexpected "No matching autocommands"
Browse files Browse the repository at this point in the history
Problem:    Unexpected "No matching autocommands".
Solution:   Do not give the message when aborting.  Mention the arguments in
            the message. (closes #8690)
  • Loading branch information
brammool committed Aug 7, 2021
1 parent 8493499 commit 1b154ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/autocmd.c
Expand Up @@ -1287,10 +1287,11 @@ do_autocmd_event(
*/
int
do_doautocmd(
char_u *arg,
char_u *arg_start,
int do_msg, // give message for no matching autocmds?
int *did_something)
{
char_u *arg = arg_start;
char_u *fname;
int nothing_done = TRUE;
int group;
Expand Down Expand Up @@ -1329,8 +1330,12 @@ do_doautocmd(
fname, NULL, TRUE, group, curbuf, NULL))
nothing_done = FALSE;

if (nothing_done && do_msg)
msg(_("No matching autocommands"));
if (nothing_done && do_msg
#ifdef FEAT_EVAL
&& !aborting()
#endif
)
smsg(_("No matching autocommands: %s"), arg_start);
if (did_something != NULL)
*did_something = !nothing_done;

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -755,6 +755,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3306,
/**/
3305,
/**/
Expand Down

0 comments on commit 1b154ea

Please sign in to comment.