mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
fix(ftdetect): source plugins in autogroup (#18237)
In `filetype.lua`, source runtime `ftdetect` scripts within the `filetypedetect` augroup, same as `filetype.vim` (and only do so if `g:did_load_ftdetect` does not exist).
This commit is contained in:
@@ -17,10 +17,14 @@ vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- These *must* be sourced after the autocommand above is created
|
-- These *must* be sourced after the autocommand above is created
|
||||||
|
if not vim.g.did_load_ftdetect then
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
|
augroup filetypedetect
|
||||||
runtime! ftdetect/*.vim
|
runtime! ftdetect/*.vim
|
||||||
runtime! ftdetect/*.lua
|
runtime! ftdetect/*.lua
|
||||||
|
augroup END
|
||||||
]]
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
-- Set a marker so that the ftdetect scripts are not sourced a second time by filetype.vim
|
-- Set a marker so that the ftdetect scripts are not sourced a second time by filetype.vim
|
||||||
vim.g.did_load_ftdetect = 1
|
vim.g.did_load_ftdetect = 1
|
||||||
|
Reference in New Issue
Block a user