Skip to content

Commit 19ea375

Browse files
committed
fix: don't run healthcheck twice for :checkhealth
nvim thinks the `health.lua` under commands is a separate healthcheck for a plugin called `commands` and tries to run it when you run `:checkhealth`. Naming the file differently and switching the `require`d module on the fly fixes that.
1 parent 4b211f3 commit 19ea375

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

plugin/codesettings.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ vim.api.nvim_create_user_command('Codesettings', function(args)
1717
cmd = 'files'
1818
end
1919
if subcommands[cmd] then
20+
-- work around the fact that nvim treats all health.lua files as healthchecks
21+
cmd = cmd == 'health' and 'healthcheck' or cmd
2022
require('codesettings.commands.' .. cmd)()
2123
else
2224
require('codesettings.util').error('Unknown subcommand: %s', cmd)

0 commit comments

Comments
 (0)