Skip to content

Commit 7ee7677

Browse files
authored
fix: add warning during kitten generation if path contains whitespace (#294)
1 parent ec6fce6 commit 7ee7677

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

lua/kitty-scrollback/api.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,31 @@ M.generate_kittens = function(generate_modes)
9393
':p'
9494
)
9595

96+
local alias_warn = {}
97+
if kitty_scrollback_kitten:find('%s') then
98+
alias_warn = {
99+
[[# WARNING]],
100+
[[# ']] .. kitty_scrollback_kitten .. [[' contains whitespace.]],
101+
[[# You may receive an error opening kitty-scrollback.nvim. If an error occurs, you can]],
102+
[[# workaround this issue by symlinking the kitty-scrollback.nvim plugin directory to]],
103+
[[# Kitty's configuration directory with the command:]],
104+
[[#]],
105+
[[# ln -s ']]
106+
.. vim.fn.fnamemodify(kitty_scrollback_kitten, ':h:h')
107+
.. [[' ~/.config/kitty/kitty-scrollback.nvim]],
108+
[[#]],
109+
[[# Then use the symlinked directory as the action_alias in kitty.conf instead of the real path]],
110+
[[#]],
111+
[[# action_alias kitty_scrollback_nvim kitten kitty-scrollback.nvim/python/kitty_scrollback_nvim.py]],
112+
[[#]],
113+
[[# Also, if you are using any kitty @ kitten commands update them to use the symlink path:]],
114+
[[#]],
115+
[[# kitty kitten kitty-scrollback.nvim/python/kitty_scrollback_nvim.py]],
116+
[[#]],
117+
[[]],
118+
}
119+
end
120+
96121
local action_alias = 'kitty_scrollback_nvim'
97122
local alias_config = {
98123
'# kitty-scrollback.nvim Kitten alias',
@@ -128,6 +153,7 @@ M.generate_kittens = function(generate_modes)
128153
}
129154

130155
local configs = {}
156+
vim.list_extend(configs, alias_warn)
131157

132158
local filetype
133159
if target_gen_modes['maps'] then

0 commit comments

Comments
 (0)