diff --git a/lua/kitty-scrollback/api.lua b/lua/kitty-scrollback/api.lua index a4e1905..05de876 100644 --- a/lua/kitty-scrollback/api.lua +++ b/lua/kitty-scrollback/api.lua @@ -93,14 +93,33 @@ M.generate_kittens = function(generate_modes) ':p' ) + local action_alias = 'kitty_scrollback_nvim' + local alias_config = { + '# kitty-scrollback.nvim Kitten alias', + 'action_alias ' .. action_alias .. ' kitten ' .. kitty_scrollback_kitten, + '', + } + local alias_config_quoted = ([[action_alias %s kitten '%s']]):format( + action_alias, + kitty_scrollback_kitten + ) + 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:]], + [[#]], + [[# If you are using Kitty version 0.38.2 or greater, then whitespace is allowed in the]], + [[# path and you can ignore this warning. Just make sure that the kitten path is]], + [[# wrapped in quotes. For example,]], + [[#]], + [[# ]] .. alias_config_quoted, + [[#]], + [[# If you are using Kitty version 0.38.1 or less, then 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') @@ -118,13 +137,6 @@ M.generate_kittens = function(generate_modes) } end - local action_alias = 'kitty_scrollback_nvim' - local alias_config = { - '# kitty-scrollback.nvim Kitten alias', - 'action_alias ' .. action_alias .. ' kitten ' .. kitty_scrollback_kitten, - '', - } - local builtin_map_configs = { '# Browse scrollback buffer in nvim', 'map kitty_mod+h ' .. action_alias,