mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
Filetype detection runs on BufRead and BufNewFile autocommands, both of which can fire without an underlying buffer, so it's incorrect to use <abuf> to determine the file path. Instead, match on <afile> and assume that the buffer we're operating on is the current buffer. This is the same assumption that filetype.vim makes, so it should be safe.