mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 03:08:13 +00:00
feat(toggle): toggles for the profiler
This commit is contained in:
parent
808879951f
commit
999ae07808
1 changed files with 32 additions and 0 deletions
|
@ -202,4 +202,36 @@ function M.health()
|
||||||
Snacks.health[ok and "ok" or "warn"](("{which-key} is %s"):format(ok and "installed" or "not installed"))
|
Snacks.health[ok and "ok" or "warn"](("{which-key} is %s"):format(ok and "installed" or "not installed"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.profiler()
|
||||||
|
return M.new({
|
||||||
|
name = "Profiler",
|
||||||
|
get = function()
|
||||||
|
return Snacks.profiler.running()
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
if state then
|
||||||
|
Snacks.profiler.start()
|
||||||
|
else
|
||||||
|
Snacks.profiler.stop()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.profiler_highlights()
|
||||||
|
return M.new({
|
||||||
|
name = "Profiler Highlights",
|
||||||
|
get = function()
|
||||||
|
return Snacks.profiler.ui.enabled
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
if state then
|
||||||
|
Snacks.profiler.ui.show()
|
||||||
|
else
|
||||||
|
Snacks.profiler.ui.hide()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue