mirror of https://github.com/folke/lazy.nvim.git
fix(ftdetect): source ftdetect files only once. Fixes #235
This commit is contained in:
parent
717cd2f3d6
commit
9f3fb38402
|
@ -11,6 +11,8 @@ M.loading = {}
|
||||||
M.init_done = false
|
M.init_done = false
|
||||||
---@type table<string,true>
|
---@type table<string,true>
|
||||||
M.disabled_rtp_plugins = { packer_compiled = true }
|
M.disabled_rtp_plugins = { packer_compiled = true }
|
||||||
|
---@type table<string,string>
|
||||||
|
M.did_ftdetect = {}
|
||||||
|
|
||||||
function M.setup()
|
function M.setup()
|
||||||
-- setup handlers
|
-- setup handlers
|
||||||
|
@ -243,9 +245,12 @@ end
|
||||||
|
|
||||||
---@param path string
|
---@param path string
|
||||||
function M.ftdetect(path)
|
function M.ftdetect(path)
|
||||||
|
if not M.did_ftdetect[path] then
|
||||||
|
M.did_ftdetect[path] = path
|
||||||
vim.cmd("augroup filetypedetect")
|
vim.cmd("augroup filetypedetect")
|
||||||
M.source_runtime(path, "ftdetect")
|
M.source_runtime(path, "ftdetect")
|
||||||
vim.cmd("augroup END")
|
vim.cmd("augroup END")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param ... string
|
---@param ... string
|
||||||
|
|
Loading…
Reference in New Issue