From b35060b2f82451ca98c862c71072b993c3f30c7c Mon Sep 17 00:00:00 2001 From: Mike Smith <10135646+mikesmithgh@users.noreply.github.com> Date: Sun, 10 Dec 2023 17:43:28 -0500 Subject: [PATCH] chore: troubleshooting --- lua/kitty-scrollback/api.lua | 18 ++++++++++++------ .../kitty-scrollback/kitty_scrollback_spec.lua | 2 +- tests/minimal_init.lua | 3 +++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lua/kitty-scrollback/api.lua b/lua/kitty-scrollback/api.lua index 2d50ea32..d5aa00eb 100644 --- a/lua/kitty-scrollback/api.lua +++ b/lua/kitty-scrollback/api.lua @@ -80,10 +80,14 @@ M.generate_kittens = function(all, generate_modes) target_gen_modes[gen_mode] = true end - local kitty_scrollback_kitten = - vim.api.nvim_get_runtime_file('python/kitty_scrollback_nvim.py', false)[1] - local example_path = - vim.api.nvim_get_runtime_file('lua/kitty-scrollback/configs/example.lua', false)[1] + local kitty_scrollback_kitten = vim.fn.fnamemodify( + vim.api.nvim_get_runtime_file('python/kitty_scrollback_nvim.py', false)[1], + ':p' + ) + local example_path = vim.fn.fnamemodify( + vim.api.nvim_get_runtime_file('lua/kitty-scrollback/configs/example.lua', false)[1], + ':p' + ) local action_alias = 'kitty_scrollback_nvim' local alias_config = { @@ -181,8 +185,10 @@ M.generate_kittens = function(all, generate_modes) end M.checkhealth = function() - local kitty_scrollback_kitten = - vim.api.nvim_get_runtime_file('python/kitty_scrollback_nvim.py', false)[1] + local kitty_scrollback_kitten = vim.fn.fnamemodify( + vim.api.nvim_get_runtime_file('python/kitty_scrollback_nvim.py', false)[1], + ':p' + ) -- NOTE(#58): nvim v0.9 support -- setup backports for v0.9 because checkhealth can be called outside of standard setup flow if vim.fn.has('nvim-0.10') <= 0 then diff --git a/tests/kitty-scrollback/kitty_scrollback_spec.lua b/tests/kitty-scrollback/kitty_scrollback_spec.lua index 4668355d..9efb2a56 100644 --- a/tests/kitty-scrollback/kitty_scrollback_spec.lua +++ b/tests/kitty-scrollback/kitty_scrollback_spec.lua @@ -89,7 +89,7 @@ $ brew search a 󰄛 it('should successfully open checkhealth', function() h.assert_screen_starts_with( h.feed_kitty({ - [[nvim +'KittyScrollbackCheckHealth']], + [[nvim +'lua vim.opt.rtp:append("../..") vim.opt.rtp:append("../../kitty-scrollback.nvim") require("kitty-scrollback").setup() vim.cmd("KittyScrollbackCheckHealth")']], [[\n]], -- enter }), [[ diff --git a/tests/minimal_init.lua b/tests/minimal_init.lua index 6d438146..85bcc53b 100644 --- a/tests/minimal_init.lua +++ b/tests/minimal_init.lua @@ -9,3 +9,6 @@ vim.opt.rtp:append(plenary_dir) vim.cmd('runtime plugin/plenary.vim') require('plenary.busted') + +vim.opt.rtp:append('kitty-scrollback.nvim') +require('kitty-scrollback').setup()