Skip to content

Commit

Permalink
fix: add warning during kitten generation if path contains whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh committed Dec 30, 2024
1 parent ec6fce6 commit 8f84f59
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lua/kitty-scrollback/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,31 @@ M.generate_kittens = function(generate_modes)
':p'
)

local alias_warn = {}
if kitty_scrollback_kitten:find('%s') then
alias_warn = {
[[# WARNING]],
[[# ']] .. kitty_scrollback_kitten .. [[' contains whitespace.]],
[[# You may receive an error opening kitty-scrollback.nvim. If an error occurs, you can]],
[[# workaround this issue by symlinking the kitty-scrollback.nvim plugin directory to]],
[[# Kitty's configuration directory with the command:]],
[[#]],
[[# ln -s ']]
.. vim.fn.fnamemodify(kitty_scrollback_kitten, ':h:h')
.. [[' ~/.config/kitty/kitty-scrollback.nvim]],
[[#]],
[[# Then use the symlinked directory as the action_alias in kitty.conf instead of the real path]],
[[#]],
[[# action_alias kitty_scrollback_nvim kitten kitty-scrollback.nvim/python/kitty_scrollback_nvim.py]],
[[#]],
[[# Also, if you are using any kitty @ kitten commands update them to use the symlink path:]],
[[#]],
[[# kitty kitten kitty-scrollback.nvim/python/kitty_scrollback_nvim.py]],
[[#]],
[[]],
}
end

local action_alias = 'kitty_scrollback_nvim'
local alias_config = {
'# kitty-scrollback.nvim Kitten alias',
Expand Down Expand Up @@ -128,6 +153,7 @@ M.generate_kittens = function(generate_modes)
}

local configs = {}
vim.list_extend(configs, alias_warn)

local filetype
if target_gen_modes['maps'] then
Expand Down

0 comments on commit 8f84f59

Please sign in to comment.