Skip to content

Commit

Permalink
fix(loader): source filetype.lua before plugins. Fixes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 20, 2022
1 parent 9d12cdc commit ffcd0ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ function M.startup()

local rtp = vim.opt.rtp:get()

Util.track({ start = "filetype" })
local ft = vim.env.VIMRUNTIME .. "/filetype.lua"
Util.try(function()
vim.cmd("silent source " .. ft)
end, "Failed to source `" .. ft .. "`")
Util.track()

-- load plugins from rtp, excluding after
Util.track({ start = "rtp plugins" })
for _, path in ipairs(rtp) do
Expand Down
1 change: 1 addition & 0 deletions lua/lazy/view/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ function M:reason(reason, opts)
reason.runtime = reason.runtime:gsub(".*/([^/]+/plugin/.*)", "%1")
reason.runtime = reason.runtime:gsub(".*/([^/]+/after/.*)", "%1")
reason.runtime = reason.runtime:gsub(".*/([^/]+/ftdetect/.*)", "%1")
reason.runtime = reason.runtime:gsub(".*/(runtime/.*)", "%1")
end
local time = reason.time and (" " .. math.floor(reason.time / 1e6 * 100) / 100 .. "ms")
if time and not opts.time_right then
Expand Down

0 comments on commit ffcd0ab

Please sign in to comment.