mirror of https://github.com/folke/lazy.nvim.git
fix(ui): use Plugin.find to detect loading reason
This commit is contained in:
parent
575421b3fb
commit
98ccf556d8
|
@ -3,6 +3,7 @@ local Util = require("lazy.util")
|
||||||
local Sections = require("lazy.view.sections")
|
local Sections = require("lazy.view.sections")
|
||||||
local Handler = require("lazy.core.handler")
|
local Handler = require("lazy.core.handler")
|
||||||
local Git = require("lazy.manage.git")
|
local Git = require("lazy.manage.git")
|
||||||
|
local Plugin = require("lazy.core.plugin")
|
||||||
|
|
||||||
local Text = require("lazy.view.text")
|
local Text = require("lazy.view.text")
|
||||||
|
|
||||||
|
@ -191,16 +192,12 @@ function M:reason(reason, opts)
|
||||||
---@type string?
|
---@type string?
|
||||||
local source = reason.source
|
local source = reason.source
|
||||||
if source then
|
if source then
|
||||||
source = vim.loop.fs_realpath(source) or source
|
local plugin = Plugin.find(source)
|
||||||
for _, other in pairs(Config.plugins) do
|
if plugin then
|
||||||
if source:find(vim.loop.fs_realpath(other.dir), 1, true) then
|
reason.plugin = plugin.name
|
||||||
reason.plugin = other.name
|
|
||||||
reason.source = nil
|
reason.source = nil
|
||||||
break
|
else
|
||||||
end
|
local config = vim.fn.stdpath("config")
|
||||||
end
|
|
||||||
if reason.source then
|
|
||||||
local config = vim.loop.fs_realpath(vim.fn.stdpath("config"))
|
|
||||||
if source == config .. "/init.lua" then
|
if source == config .. "/init.lua" then
|
||||||
reason.source = "init.lua"
|
reason.source = "init.lua"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue