Skip to content

Commit 98ccf55

Browse files
committed
fix(ui): use Plugin.find to detect loading reason
1 parent 575421b commit 98ccf55

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lua/lazy/view/render.lua

+7-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ local Util = require("lazy.util")
33
local Sections = require("lazy.view.sections")
44
local Handler = require("lazy.core.handler")
55
local Git = require("lazy.manage.git")
6+
local Plugin = require("lazy.core.plugin")
67

78
local Text = require("lazy.view.text")
89

@@ -191,16 +192,12 @@ function M:reason(reason, opts)
191192
---@type string?
192193
local source = reason.source
193194
if source then
194-
source = vim.loop.fs_realpath(source) or source
195-
for _, other in pairs(Config.plugins) do
196-
if source:find(vim.loop.fs_realpath(other.dir), 1, true) then
197-
reason.plugin = other.name
198-
reason.source = nil
199-
break
200-
end
201-
end
202-
if reason.source then
203-
local config = vim.loop.fs_realpath(vim.fn.stdpath("config"))
195+
local plugin = Plugin.find(source)
196+
if plugin then
197+
reason.plugin = plugin.name
198+
reason.source = nil
199+
else
200+
local config = vim.fn.stdpath("config")
204201
if source == config .. "/init.lua" then
205202
reason.source = "init.lua"
206203
else

0 commit comments

Comments
 (0)