mirror of https://github.com/folke/lazy.nvim.git
feat: show module source if loading source is under config
This commit is contained in:
parent
64af691be3
commit
041a716f4e
|
@ -16,9 +16,7 @@ local Text = require("lazy.view.text")
|
|||
---@field _diagnostics LazyDiagnostic[]
|
||||
---@field plugin_range table<string, {from: number, to: number}>
|
||||
---@field _details? string
|
||||
local M = setmetatable({}, {
|
||||
__index = Text,
|
||||
})
|
||||
local M = setmetatable({}, { __index = Text })
|
||||
|
||||
function M.new(buf, win, padding)
|
||||
local self = setmetatable({}, { __index = M })
|
||||
|
@ -201,6 +199,16 @@ function M:reason(reason, opts)
|
|||
break
|
||||
end
|
||||
end
|
||||
if reason.source then
|
||||
source = vim.loop.fs_realpath(source) or source
|
||||
local config = vim.loop.fs_realpath(vim.fn.stdpath("config") .. "/lua")
|
||||
if source:find(config, 1, true) == 1 then
|
||||
reason.source = source:sub(#config + 2):gsub("/", "."):gsub("%.lua$", "")
|
||||
if reason.source == "lua" then
|
||||
reason.source = "init.lua"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local time = " " .. math.floor((reason.time or 0) / 1e6 * 100) / 100 .. "ms"
|
||||
if not opts.time_right then
|
||||
|
|
Loading…
Reference in New Issue