feat: add :LocMetrics heatmap and refactor core for LOC reduction

This commit is contained in:
2026-05-10 23:10:20 +00:00
parent c36814ad06
commit eb7ffe0c9a
4 changed files with 580 additions and 54 deletions
+6 -2
View File
@@ -17,7 +17,7 @@ vim.api.nvim_create_user_command("LocReset", function()
end, { desc = "Reset loc.nvim character counters" })
vim.api.nvim_create_user_command("LocStats", function()
local stats = require("loc").stats()
local stats = require("loc").display_stats()
local message = string.format(
"LOC added=%d deleted=%d net=%+d",
stats.added,
@@ -26,4 +26,8 @@ vim.api.nvim_create_user_command("LocStats", function()
)
vim.notify(message, vim.log.levels.INFO)
end, { desc = "Show loc.nvim character counters" })
end, { desc = "Show loc.nvim estimated LOC counters" })
vim.api.nvim_create_user_command("LocMetrics", function()
require("loc").metrics()
end, { desc = "Show loc.nvim 30-day LOC metrics heatmap" })