feat(ui): improvements to profiling and rendering of loaded reasons

This commit is contained in:
Folke Lemaitre 2022-12-01 16:27:52 +01:00
parent 5eb2622a4e
commit 714bc0a136
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 21 additions and 12 deletions

View file

@ -217,7 +217,16 @@ function M:reason(reason, opts)
self:append(" ")
-- self:append(" (", "Conceal")
local first = true
for key, value in pairs(reason) do
local keys = vim.tbl_keys(reason)
table.sort(keys)
if vim.tbl_contains(keys, "plugin") then
keys = vim.tbl_filter(function(key)
return key ~= "plugin"
end, keys)
table.insert(keys, "plugin")
end
for _, key in ipairs(keys) do
local value = reason[key]
if type(key) == "number" then
elseif key == "require" then
-- self:append("require", "@function.builtin")