fix(filetype): make recursive work...again (#22826)

This commit is contained in:
Lewis Russell 2023-03-30 17:24:50 +01:00 committed by GitHub
parent 226a6c3eae
commit 5bf2f4b3c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2778,7 +2778,7 @@ void do_filetype_autocmd(buf_T *buf, bool force)
did_filetype = true;
// Only pass true for "force" when it is true or
// used recursively, to avoid endless recurrence.
apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, buf->b_fname, force, buf);
apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, buf->b_fname, force || ft_recursive == 1, buf);
ft_recursive--;
// Just in case the old "buf" is now invalid