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'`
This commit is contained in:
monkoose 2024-09-11 07:55:37 +03:00 committed by GitHub
parent 15bfdf73ea
commit 237d2aef4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -285,8 +285,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('/', '.')