fix(health): return correct name from 'path2name()'

`path2name()` function doesn't process `'pluginname/health/init.lua'` correctly. Instead of retruning `'pluginname'` it returns `'pluginname.health'`

(cherry picked from commit 237d2aef4d)
This commit is contained in:
monkoose
2024-09-11 07:55:37 +03:00
committed by tris203
parent ef05c514aa
commit 1e1e4066b1

View File

@ -350,8 +350,8 @@ local path2name = function(path)
-- Remove everything up to the last /lua/ folder
path = path:gsub('^.*/lua/', '')
-- Remove the filename (health.lua)
path = vim.fs.dirname(path)
-- Remove the filename (health.lua) or (health/init.lua)
path = vim.fs.dirname(path:gsub('/init%.lua$', ''))
-- Change slashes to dots
path = path:gsub('/', '.')