Skip to content

Commit fea315d

Browse files
committed
feat: remove jobstart workaround since Neovim v0.11 is released
closes #306
1 parent 01574fa commit fea315d

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

lua/kitty-scrollback/kitty_commands.lua

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,7 @@ local function defer_resize_term(min_cols)
6363
return orig_columns
6464
end
6565

66-
local open_term_command_from_nvim_version = function()
67-
if vim.fn.has('nvim-0.11') == 1 then
68-
-- intentionally pass an invalid argument type to term
69-
-- if an error is returned that it must be boolean then term exists for jobstart
70-
---@type boolean, integer|string
71-
local ok, err = pcall(vim.fn.jobstart, '', { term = 1 })
72-
local jobstart_has_term = not ok
73-
and err:match([[Vim:E475: Invalid argument: 'term' must be Boolean]])
74-
and true
75-
or false
76-
if jobstart_has_term then
77-
return 'jobstart'
78-
else
79-
-- using Neovim v0.11, however, it is on a commit before implementing term on jobstart
80-
return 'termopen'
81-
end
82-
else
83-
-- earlier versions of Neovim use termopen
84-
return 'termopen'
85-
end
86-
end
87-
88-
M.open_term_command = open_term_command_from_nvim_version()
66+
M.open_term_command = vim.fn.has('nvim-0.11') <= 0 and 'termopen' or 'jobstart'
8967

9068
---@param get_text_opts KsbKittyGetTextArguments
9169
---@param on_exit_cb function

0 commit comments

Comments
 (0)