From ffcd0ab7bb61bd15b24d2a47509861e30644143c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 20 Dec 2022 20:32:37 +0100 Subject: [PATCH] fix(loader): source filetype.lua before plugins. Fixes #35 --- lua/lazy/core/loader.lua | 7 +++++++ lua/lazy/view/render.lua | 1 + 2 files changed, 8 insertions(+) diff --git a/lua/lazy/core/loader.lua b/lua/lazy/core/loader.lua index bd11ea8..718f6df 100644 --- a/lua/lazy/core/loader.lua +++ b/lua/lazy/core/loader.lua @@ -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 diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index 67d306b..bf67683 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -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