aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonkoose <pythonproof@gmail.com>2024-09-11 07:55:37 +0300
committerGitHub <noreply@github.com>2024-09-11 07:55:37 +0300
commit237d2aef4d706a787e940670072839f82da41046 (patch)
tree057344a0427a1280c153760426cfa0a49f7df6b5
parent15bfdf73ea17e513edcec63be9ba27a5f4f12c7a (diff)
downloadrneovim-237d2aef4d706a787e940670072839f82da41046.tar.gz
rneovim-237d2aef4d706a787e940670072839f82da41046.tar.bz2
rneovim-237d2aef4d706a787e940670072839f82da41046.zip
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'`
-rw-r--r--runtime/lua/vim/health.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/health.lua b/runtime/lua/vim/health.lua
index d183c82516..f260d44b50 100644
--- a/runtime/lua/vim/health.lua
+++ b/runtime/lua/vim/health.lua
@@ -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('/', '.')