diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 152184e75c..8ce2ff771d 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -2737,7 +2737,6 @@ void do_filetype_autocmd(buf_T *buf, bool force) return; // disallow recursion } - char **varp = &buf->b_p_ft; int secure_save = secure; // Reset the secure flag, since the value of 'filetype' has @@ -2751,9 +2750,5 @@ void do_filetype_autocmd(buf_T *buf, bool force) 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 - if (varp != &(buf->b_p_ft)) { - varp = NULL; - } secure = secure_save; } diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index fb8235c1b3..38008a1239 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4141,10 +4141,7 @@ bool buf_contents_changed(buf_T *buf) return differ; } -/// Wipe out a buffer and decrement the last buffer number if it was used for -/// this buffer. Call this to wipe out a temp buffer that does not contain any -/// marks. -/// +/// Wipe out a (typically temporary) buffer. /// @param aucmd When true trigger autocommands. void wipe_buffer(buf_T *buf, bool aucmd) {