diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 0a8a22d3c3..0ab608ad31 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -2644,7 +2644,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 @@ -2658,9 +2657,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 b7e311d03f..98bf7b974a 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4100,10 +4100,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) {