Skip to content

Commit

Permalink
fix(ftdetect): source plugins in autogroup (#18362)
Browse files Browse the repository at this point in the history
(cherry picked from commit 244b371)

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
  • Loading branch information
github-actions[bot] and clason committed May 2, 2022
1 parent ffd46b7 commit 508c8a5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions runtime/filetype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
})

-- These *must* be sourced after the autocommand above is created
vim.cmd [[
runtime! ftdetect/*.vim
runtime! ftdetect/*.lua
]]
if not vim.g.did_load_ftdetect then
vim.cmd [[
augroup filetypedetect
runtime! ftdetect/*.vim
runtime! ftdetect/*.lua
augroup END
]]
end

-- Set a marker so that the ftdetect scripts are not sourced a second time by filetype.vim
vim.g.did_load_ftdetect = 1
Expand Down

0 comments on commit 508c8a5

Please sign in to comment.