From 4b211f379bd3220a44519501e9fce64e5e2c8543 Mon Sep 17 00:00:00 2001 From: Oula Kuuva Date: Wed, 24 Dec 2025 17:48:08 +0200 Subject: [PATCH 1/2] fix: health subcommand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It wasn't doing anything. Not sure how to trigger healthcheck with the lua API but this does the trick and is simple enough so `¯\_(ツ)_/¯` --- lua/codesettings/commands/health.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/codesettings/commands/health.lua b/lua/codesettings/commands/health.lua index 76a68e0..0ccc31e 100644 --- a/lua/codesettings/commands/health.lua +++ b/lua/codesettings/commands/health.lua @@ -1,3 +1,3 @@ return function() - require('codesettings.health').check() + vim.cmd('checkhealth codesettings') end From 19ea375e093dfe317addc0cc1d4b3f1d0b5b7667 Mon Sep 17 00:00:00 2001 From: Oula Kuuva Date: Wed, 24 Dec 2025 17:30:19 +0200 Subject: [PATCH 2/2] 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. --- lua/codesettings/commands/{health.lua => healthcheck.lua} | 0 plugin/codesettings.lua | 2 ++ 2 files changed, 2 insertions(+) rename lua/codesettings/commands/{health.lua => healthcheck.lua} (100%) diff --git a/lua/codesettings/commands/health.lua b/lua/codesettings/commands/healthcheck.lua similarity index 100% rename from lua/codesettings/commands/health.lua rename to lua/codesettings/commands/healthcheck.lua diff --git a/plugin/codesettings.lua b/plugin/codesettings.lua index 094491d..640e7f6 100644 --- a/plugin/codesettings.lua +++ b/plugin/codesettings.lua @@ -17,6 +17,8 @@ vim.api.nvim_create_user_command('Codesettings', function(args) cmd = 'files' end if subcommands[cmd] then + -- work around the fact that nvim treats all health.lua files as healthchecks + cmd = cmd == 'health' and 'healthcheck' or cmd require('codesettings.commands.' .. cmd)() else require('codesettings.util').error('Unknown subcommand: %s', cmd)