From 888329ee7df8251647c3ea8ec6bc648f36319fb9 Mon Sep 17 00:00:00 2001 From: leo-arch Date: Wed, 13 Nov 2024 15:15:17 -0300 Subject: [PATCH] Clear matches after running 'auto none' --- src/autocmds.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/autocmds.c b/src/autocmds.c index 33fd214c..03e72086 100644 --- a/src/autocmds.c +++ b/src/autocmds.c @@ -920,7 +920,13 @@ print_autocmds_list(void) static int reload_dir_ignoring_autocmds(void) { + if (autocmds_n == 0) { + fputs("auto: No autocommand defined\n", stdout); + return FUNC_SUCCESS; + } + revert_autocmd_opts(); + unset_autocmd_matches(); dir_changed = 0; reload_dirlist(); return FUNC_SUCCESS;