Skip to content

Commit 2d32201

Browse files
authored
revert(termopen): replace termopen with jobstart (#675)
1 parent 4a2f2d2 commit 2d32201

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/rustaceanvim/executors/termopen.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,15 @@ local M = {
2929
-- close the buffer when escape is pressed :)
3030
vim.keymap.set('n', '<Esc>', '<CMD>q<CR>', { buffer = latest_buf_id, noremap = true })
3131

32+
-- TODO(0.11): Replace with vim.fn.jobstart(full_command, { term = true })
3233
-- run the command
33-
vim.fn.jobstart(full_command, { term = true })
34+
---@diagnostic disable-next-line: deprecated
35+
if type(vim.fn.termopen) == 'function' then
36+
---@diagnostic disable-next-line: deprecated
37+
vim.fn.termopen(full_command)
38+
else
39+
vim.fn.jobstart(full_command, { term = true })
40+
end
3441

3542
-- when the buffer is closed, set the latest buf id to nil else there are
3643
-- some edge cases with the id being sit but a buffer not being open

0 commit comments

Comments
 (0)