From a29f9178fe584f95a8ac03b7b6cda7c44ce60110 Mon Sep 17 00:00:00 2001 From: Mike <10135646+mikesmithgh@users.noreply.github.com> Date: Mon, 1 Jan 2024 21:38:08 -0500 Subject: [PATCH] fix: add fallback for kitty during checkhealth (#139) closes #138 --- lua/kitty-scrollback/health.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/kitty-scrollback/health.lua b/lua/kitty-scrollback/health.lua index 1d46b6c4..3fc23de8 100644 --- a/lua/kitty-scrollback/health.lua +++ b/lua/kitty-scrollback/health.lua @@ -15,7 +15,8 @@ end local function check_kitty_remote_control() vim.health.start('kitty-scrollback: Kitty remote control') local cmd = { - p.kitty_data.kitty_path, + -- fallback to 'kitty' because checkhealth can be called outside of standard setup flow + (p and p.kitty_data and p.kitty_data.kitty_path) and p.kitty_data.kitty_path or 'kitty', '@', 'ls', } @@ -70,7 +71,7 @@ local function check_has_kitty_data() .. kitty_scrollback_kitten .. ' --config ksb_builtin_checkhealth`' vim.health.warn('No Kitty data available unable to perform a complete healthcheck', { - 'Add the config options `checkhealth = true` to your *config* or execute the command `:KittyScrollbackCheckHealth` ' + 'Execute the command `:KittyScrollbackCheckHealth` or add the config options `checkhealth = true` to your *config* ' .. 'to run `checkhealth` within the context of a Kitten', checkhealth_command, })