diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-12-06 20:57:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-06 20:57:21 +0800 |
| commit | 1077843b9bee550fe2ae1e3e700a9c135005d593 (patch) | |
| tree | 0787d0c0dff5aa0ad8dcdcb21163fc8aea79c1c2 /runtime | |
| parent | 367182abd501876819620eb1a353fc187e34849c (diff) | |
| download | rneovim-1077843b9bee550fe2ae1e3e700a9c135005d593.tar.gz rneovim-1077843b9bee550fe2ae1e3e700a9c135005d593.tar.bz2 rneovim-1077843b9bee550fe2ae1e3e700a9c135005d593.zip | |
fix(filetype): make filetype detection work with :doautocmd (#31470)
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/filetype.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/filetype.lua b/runtime/filetype.lua index 797033da06..730991a00c 100644 --- a/runtime/filetype.lua +++ b/runtime/filetype.lua @@ -13,8 +13,8 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile', 'StdinReadPost' }, { end local ft, on_detect = vim.filetype.match({ -- The unexpanded file name is needed here. #27914 - -- Neither args.file nor args.match are guaranteed to be unexpanded. - filename = vim.fn.bufname(args.buf), + -- However, bufname() can't be used, as it doesn't work with :doautocmd. #31306 + filename = args.file, buf = args.buf, }) if not ft then |